[svn:parrot] r42440 - in trunk: . compilers/imcc config/auto config/gen/makefiles config/init config/inter include/parrot include/pmc lib/Parrot/OpTrans lib/Parrot/Ops2c lib/Parrot/Pmc2c src/call src/interp src/io src/pmc src/runcore t/tools/pmc2cutils tools/dev

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Nov 12 09:49:15 UTC 2009


Author: bacek
Date: Thu Nov 12 09:49:10 2009
New Revision: 42440
URL: https://trac.parrot.org/parrot/changeset/42440

Log:
Merge branch pmc_headers_move back to trunk.

MANIFEST requires regenerating.

Added:
   trunk/include/pmc/
   trunk/include/pmc/dummy
Modified:
   trunk/MANIFEST.generated
   trunk/compilers/imcc/imcc.y
   trunk/compilers/imcc/imcparser.c
   trunk/compilers/imcc/instructions.c
   trunk/compilers/imcc/main.c
   trunk/compilers/imcc/optimizer.c
   trunk/compilers/imcc/parser_util.c
   trunk/compilers/imcc/pbc.c
   trunk/config/auto/cgoto.pm
   trunk/config/auto/pmc.pm
   trunk/config/gen/makefiles/dynpmc.in
   trunk/config/gen/makefiles/pirc.in
   trunk/config/gen/makefiles/root.in
   trunk/config/init/defaults.pm
   trunk/config/inter/charset.pm
   trunk/config/inter/encoding.pm
   trunk/include/parrot/context.h
   trunk/lib/Parrot/OpTrans/C.pm
   trunk/lib/Parrot/Ops2c/Utils.pm
   trunk/lib/Parrot/Pmc2c/PMC.pm
   trunk/lib/Parrot/Pmc2c/PMCEmitter.pm
   trunk/lib/Parrot/Pmc2c/UtilFunctions.pm
   trunk/src/call/args.c
   trunk/src/call/context.c
   trunk/src/call/context_accessors.c
   trunk/src/call/ops.c
   trunk/src/call/pcc.c
   trunk/src/interp/inter_create.c
   trunk/src/interp/inter_misc.c
   trunk/src/io/api.c
   trunk/src/io/filehandle.c
   trunk/src/io/socket_api.c
   trunk/src/io/socket_unix.c
   trunk/src/io/socket_win32.c
   trunk/src/pmc/addrregistry.pmc
   trunk/src/pmc/class.pmc
   trunk/src/pmc/context.pmc
   trunk/src/pmc/continuation.pmc
   trunk/src/pmc/eval.pmc
   trunk/src/pmc/exception.pmc
   trunk/src/pmc/hash.pmc
   trunk/src/pmc/hashiterator.pmc
   trunk/src/pmc/integer.pmc
   trunk/src/pmc/lexinfo.pmc
   trunk/src/pmc/multisub.pmc
   trunk/src/pmc/namespace.pmc
   trunk/src/pmc/object.pmc
   trunk/src/pmc/orderedhashiterator.pmc
   trunk/src/pmc/packfile.pmc
   trunk/src/pmc/packfileannotations.pmc
   trunk/src/pmc/parrotinterpreter.pmc
   trunk/src/pmc/role.pmc
   trunk/src/pmc/scalar.pmc
   trunk/src/pmc/undef.pmc
   trunk/src/runcore/cores.c
   trunk/src/runcore/main.c
   trunk/src/runcore/profiling.c
   trunk/src/runcore/trace.c
   trunk/t/tools/pmc2cutils/05-gen_c.t
   trunk/tools/dev/checkdepend.pl

Modified: trunk/MANIFEST.generated
==============================================================================
--- trunk/MANIFEST.generated	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/MANIFEST.generated	Thu Nov 12 09:49:10 2009	(r42440)
@@ -229,26 +229,26 @@
 src/pmc/integer.dump                              [devel]src
 src/pmc/multisub.dump                             [devel]src
 src/pmc/object.dump                               [devel]src
-src/pmc/pmc_boolean.h                             [devel]include
-src/pmc/pmc_class.h                               [devel]include
-src/pmc/pmc_callsignature.h                       [devel]include
-src/pmc/pmc_continuation.h                        [devel]include
-src/pmc/pmc_context.h                             [devel]include
-src/pmc/pmc_default.h                             [devel]include
-src/pmc/pmc_fixedintegerarray.h                   [devel]include
-src/pmc/pmc_fixedpmcarray.h                       [devel]include
-src/pmc/pmc_float.h                               [devel]include
-src/pmc/pmc_hash.h                                [devel]include
-src/pmc/pmc_integer.h                             [devel]include
-src/pmc/pmc_multisub.h                            [devel]include
-src/pmc/pmc_object.h                              [devel]include
-src/pmc/pmc_parrotlibrary.h                       [devel]include
-src/pmc/pmc_resizablepmcarray.h                   [devel]include
-src/pmc/pmc_role.h                                [devel]include
-src/pmc/pmc_scalar.h                              [devel]include
-src/pmc/pmc_string.h                              [devel]include
-src/pmc/pmc_sub.h                                 [devel]include
-src/pmc/pmc_undef.h                               [devel]include
+include/pmc/pmc_boolean.h                         [devel]include
+include/pmc/pmc_class.h                           [devel]include
+include/pmc/pmc_callsignature.h                   [devel]include
+include/pmc/pmc_continuation.h                    [devel]include
+include/pmc/pmc_context.h                         [devel]include
+include/pmc/pmc_default.h                         [devel]include
+include/pmc/pmc_fixedintegerarray.h               [devel]include
+include/pmc/pmc_fixedpmcarray.h                   [devel]include
+include/pmc/pmc_float.h                           [devel]include
+include/pmc/pmc_hash.h                            [devel]include
+include/pmc/pmc_integer.h                         [devel]include
+include/pmc/pmc_multisub.h                        [devel]include
+include/pmc/pmc_object.h                          [devel]include
+include/pmc/pmc_parrotlibrary.h                   [devel]include
+include/pmc/pmc_resizablepmcarray.h               [devel]include
+include/pmc/pmc_role.h                            [devel]include
+include/pmc/pmc_scalar.h                          [devel]include
+include/pmc/pmc_string.h                          [devel]include
+include/pmc/pmc_sub.h                             [devel]include
+include/pmc/pmc_undef.h                           [devel]include
 src/pmc/resizablepmcarray.dump                    [devel]src
 src/pmc/role.dump                                 [devel]src
 src/pmc/scalar.dump                               [devel]src

Modified: trunk/compilers/imcc/imcc.y
==============================================================================
--- trunk/compilers/imcc/imcc.y	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/compilers/imcc/imcc.y	Thu Nov 12 09:49:10 2009	(r42440)
@@ -21,7 +21,7 @@
 #define PARSER_MAIN
 #include "imc.h"
 #include "parrot/dynext.h"
-#include "../src/pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 #include "pbc.h"
 #include "parser.h"
 #include "optimizer.h"

Modified: trunk/compilers/imcc/imcparser.c
==============================================================================
--- trunk/compilers/imcc/imcparser.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/compilers/imcc/imcparser.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -103,7 +103,7 @@
 #define PARSER_MAIN
 #include "imc.h"
 #include "parrot/dynext.h"
-#include "../src/pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 #include "pbc.h"
 #include "parser.h"
 #include "optimizer.h"

Modified: trunk/compilers/imcc/instructions.c
==============================================================================
--- trunk/compilers/imcc/instructions.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/compilers/imcc/instructions.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -9,7 +9,7 @@
 #include "imc.h"
 #include "pbc.h"
 #include "optimizer.h"
-#include "../src/pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 
 /*
 

Modified: trunk/compilers/imcc/main.c
==============================================================================
--- trunk/compilers/imcc/main.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/compilers/imcc/main.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -34,7 +34,7 @@
 #include "parrot/longopt.h"
 #include "parrot/imcc.h"
 #include "parrot/runcore_api.h"
-#include "../src/pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 #include "pbc.h"
 #include "parser.h"
 

Modified: trunk/compilers/imcc/optimizer.c
==============================================================================
--- trunk/compilers/imcc/optimizer.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/compilers/imcc/optimizer.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -73,7 +73,7 @@
 #include "imc.h"
 #include "pbc.h"
 #include "optimizer.h"
-#include "../src/pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 
 /* HEADERIZER HFILE: compilers/imcc/optimizer.h */
 

Modified: trunk/compilers/imcc/parser_util.c
==============================================================================
--- trunk/compilers/imcc/parser_util.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/compilers/imcc/parser_util.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -21,8 +21,8 @@
 #include "imc.h"
 #include "parrot/dynext.h"
 #include "parrot/embed.h"
-#include "../../src/pmc/pmc_sub.h"
-#include "../../src/pmc/pmc_context.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_context.h"
 #include "pbc.h"
 #include "parser.h"
 #include "optimizer.h"

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/compilers/imcc/pbc.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -6,8 +6,8 @@
 #include "imc.h"
 #include "pbc.h"
 #include "parrot/packfile.h"
-#include "../src/pmc/pmc_sub.h"
-#include "../src/pmc/pmc_context.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_context.h"
 
 /* HEADERIZER HFILE: compilers/imcc/pbc.h */
 

Modified: trunk/config/auto/cgoto.pm
==============================================================================
--- trunk/config/auto/cgoto.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/auto/cgoto.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -63,9 +63,9 @@
 # generated by config/auto/cgoto.pm
 
 $(OPS_DIR)/core_ops_cg$(O): $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_cg.c \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
 $(OPS_DIR)/core_ops_cgp$(O): $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_cgp.c \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
 $(SRC_DIR)/runcore/cores.c: $(INC_DIR)/oplib/core_ops_cgp.h
 
 $(INC_DIR)/oplib/core_ops_cg.h: $(OPS_DIR)/core_ops_cg.c

Modified: trunk/config/auto/pmc.pm
==============================================================================
--- trunk/config/auto/pmc.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/auto/pmc.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -77,7 +77,7 @@
         $parent_dumps .= "src/pmc/$_.dump "
             foreach reverse( ( $self->pmc_parents($pmc) ) );
         my $parent_headers = '';
-        $parent_headers .= "src/pmc/pmc_$_.h "
+        $parent_headers .= "include/pmc/pmc_$_.h "
             for $self->pmc_parents($pmc);
 
         # add dependencies that result from METHOD usage.
@@ -86,7 +86,7 @@
         if (contains_pccmethod($pmc_fname)) {
             $pccmethod_depend = 'lib/Parrot/Pmc2c/PCCMETHOD.pm';
             if ($pmc ne 'fixedintegerarray') {
-                $pccmethod_depend .= ' src/pmc/pmc_fixedintegerarray.h';
+                $pccmethod_depend .= ' include/pmc/pmc_fixedintegerarray.h';
             }
         }
         my $include_headers = get_includes($pmc_fname);
@@ -98,16 +98,16 @@
 src/pmc/$pmc.dump : vtable.dump $parent_dumps src/pmc/$pmc.pmc \$(PMC2C_FILES) $pccmethod_depend
 \t\$(PMC2CD) src/pmc/$pmc.pmc
 
-src/pmc/pmc_$pmc.h: src/pmc/$pmc.c
+\$(PMC_INC_DIR)/pmc/pmc_$pmc.h: src/pmc/$pmc.c
 
-src/pmc/$pmc\$(O): src/pmc/pmc_${pmc}.h src/pmc/$pmc.str \$(NONGEN_HEADERS) \\
-    $parent_headers $include_headers src/pmc/pmc_continuation.h \\
-    src/pmc/pmc_context.h src/pmc/pmc_fixedintegerarray.h
+src/pmc/$pmc\$(O): include/pmc/pmc_${pmc}.h src/pmc/$pmc.str \$(NONGEN_HEADERS) \\
+    $parent_headers $include_headers include/pmc/pmc_continuation.h \\
+    include/pmc/pmc_context.h include/pmc/pmc_fixedintegerarray.h
 
 END
     }
 
-    # src/pmc/$pmc\$(O): \$(NONGEN_HEADERS) $parent_headers src/pmc/pmc_$pmc.h
+    # src/pmc/$pmc\$(O): \$(NONGEN_HEADERS) $parent_headers include/pmc/pmc_$pmc.h
 
     # build list of libraries for link line in Makefile
     my $slash = $conf->data->get('slash');
@@ -173,6 +173,7 @@
         TEMP_pmc_classes_o   => $TEMP_pmc_classes_o,
         TEMP_pmc_classes_str => $TEMP_pmc_classes_str,
         TEMP_pmc_classes_pmc => $TEMP_pmc_classes_pmc,
+        pmc_inc              => 'include',
     );
 
     return 1;
@@ -272,6 +273,8 @@
           $include = "include/" . $include;
         } elsif ($include =~ m/^pmc_|\.str$/) { # local pmc header
           $include = "src/pmc/" . $include;
+        } elsif ($include =~ m/^pmc\/pmc_|\.h$/) { # local pmc header
+          $include = "include/" . $include;
         } # else it's probably a system header, don't depend on it.
         push @retval, $include;
     }

Modified: trunk/config/gen/makefiles/dynpmc.in
==============================================================================
--- trunk/config/gen/makefiles/dynpmc.in	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/gen/makefiles/dynpmc.in	Thu Nov 12 09:49:10 2009	(r42440)
@@ -20,7 +20,7 @@
 BUILD_TOOLS_DIR := $(BUILD_DIR)@slash at tools@slash at build
 BUILD_LIB_DIR   := $(BUILD_DIR)@slash at blib@slash at lib
 PMC2C           := $(PERL) $(BUILD_TOOLS_DIR)@slash at pmc2c.pl
-INCLUDES        := -I$(BUILD_DIR)@slash at include -I at build_dir@@slash at src@slash at pmc
+INCLUDES        := -I$(BUILD_DIR)@slash at include -I at build_dir@@slash at include@slash at pmc
 LINKARGS        := $(LDFLAGS) $(LD_LOAD_FLAGS) $(LIBPARROT) @icu_shared@ @libs@
 
 PMC2CD := $(PERL) $(BUILD_TOOLS_DIR)/pmc2c.pl --dump

Modified: trunk/config/gen/makefiles/pirc.in
==============================================================================
--- trunk/config/gen/makefiles/pirc.in	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/gen/makefiles/pirc.in	Thu Nov 12 09:49:10 2009	(r42440)
@@ -14,7 +14,7 @@
 CC            := @cc@
 O             := @o@
 EXE           := @exe@
-CC_INC        := -I../../include
+CC_INC        := -I../../include -I../../include/pmc
 C_LIBS        := @libs@
 CC_SHARED     := @cc_shared@
 CFLAGS        := $(CC_INC) @ccflags@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@ $(CC_SHARED)

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/gen/makefiles/root.in	Thu Nov 12 09:49:10 2009	(r42440)
@@ -62,6 +62,9 @@
 # directory for header files
 INC_DIR         := @inc@
 
+# directory for PMC generated header files
+PMC_INC_DIR     := @pmc_inc@
+
 # directory for the IO subsystem
 IO_DIR          := src/io
 
@@ -840,6 +843,9 @@
 
 $(INC_DIR)/extend.h : $(INC_DIR)/extend_vtable.h
 
+$(INC_DIR)/parrot.h  : $(INC_DIR)/context.h
+$(INC_DIR)/context.h : $(PMC_INC_DIR)/pmc/pmc_context.h
+
 $(INC_DIR)/pbcversion.h :
 	$(PERL) $(BUILD_TOOLS_DIR)/pbcversion_h.pl > $(INC_DIR)/pbcversion.h
 
@@ -867,14 +873,17 @@
 
 $(SRC_DIR)/null_config$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/null_config.c
 
-$(SRC_DIR)/oo$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/pmc_class.h $(SRC_DIR)/pmc/pmc_object.h $(SRC_DIR)/pmc/pmc_context.h $(INC_DIR)/pbcversion.h $(SRC_DIR)/oo.str
+$(SRC_DIR)/oo$(O) : $(INC_DIR)/parrot.h $(PMC_INC_DIR)/pmc/pmc_class.h $(PMC_INC_DIR)/pmc/pmc_object.h $(PMC_INC_DIR)/pmc/pmc_context.h $(INC_DIR)/pbcversion.h $(SRC_DIR)/oo.str
 
 $(SRC_DIR)/scheduler$(O) : $(INC_DIR)/parrot.h \
-                           $(SRC_DIR)/scheduler.str \
-                           $(SRC_DIR)/pmc/pmc_scheduler.h \
-                           $(SRC_DIR)/pmc/pmc_context.h \
-                           $(SRC_DIR)/pmc/pmc_task.h \
-                           $(SRC_DIR)/pmc/pmc_timer.h \
+                           $(SRC_DIR)/scheduler.str   \
+                           $(SRC_DIR)/pmc/scheduler.c \
+                           $(PMC_INC_DIR)/pmc/pmc_context.h \
+                           $(PMC_INC_DIR)/pmc/pmc_scheduler.h \
+                           $(PMC_INC_DIR)/pmc/pmc_task.h \
+                           $(PMC_INC_DIR)/pmc/pmc_timer.h \
+                           $(SRC_DIR)/pmc/task.c      \
+                           $(SRC_DIR)/pmc/timer.c     \
                            $(INC_DIR)/pbcversion.h
 
 $(IO_DIR)/core$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/socket.c
@@ -971,7 +980,7 @@
 #
 # Parrot Dump
 #
-$(SRC_DIR)/packdump$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_key.h
+$(SRC_DIR)/packdump$(O) : $(INC_DIR)/parrot.h $(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_key.h
 
 $(PDUMP) : $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
@@ -1063,18 +1072,18 @@
 
 $(SRC_DIR)/extend_vtable$(O) : $(INC_DIR)/parrot.h
 
-$(SRC_DIR)/global_setup$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/global_setup.str $(SRC_DIR)/pmc/pmc_context.h
+$(SRC_DIR)/global_setup$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/global_setup.str $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/global$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/global.str \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_context.h
 
-$(SRC_DIR)/pmc$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_class.h \
-	$(SRC_DIR)/pmc.str $(SRC_DIR)/pmc/pmc_context.h
+$(SRC_DIR)/pmc$(O) : $(GENERAL_H_FILES) $(PMC_INC_DIR)/pmc/pmc_class.h \
+	$(SRC_DIR)/pmc.str $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/pmc_freeze$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc_freeze.str \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
-$(SRC_DIR)/hash$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_key.h
+$(SRC_DIR)/hash$(O) : $(GENERAL_H_FILES) $(PMC_INC_DIR)/pmc/pmc_key.h
 
 $(SRC_DIR)/list$(O) : $(GENERAL_H_FILES)
 
@@ -1084,7 +1093,7 @@
 	$(PERL) $(BUILD_TOOLS_DIR)/vtable_extend.pl
 
 $(SRC_DIR)/key$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/key.str \
-        $(SRC_DIR)/pmc/pmc_key.h $(SRC_DIR)/pmc/pmc_context.h
+        $(PMC_INC_DIR)/pmc/pmc_key.h $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/gc/mark_sweep$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/gc/gc_private.h
 
@@ -1099,7 +1108,7 @@
 $(SRC_DIR)/gc/alloc_resources$(O) : $(GENERAL_H_FILES) \
         $(SRC_DIR)/gc/gc_private.h
 
-$(SRC_DIR)/hll$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/hll.str $(SRC_DIR)/pmc/pmc_context.h
+$(SRC_DIR)/hll$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/hll.str $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/platform$(O) : $(GENERAL_H_FILES)
 
@@ -1107,17 +1116,17 @@
 #IF(platform_asm):
 $(SRC_DIR)/core_pmcs$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/runcore/trace$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_sub.h \
-        $(SRC_DIR)/pmc/pmc_context.h
+$(SRC_DIR)/runcore/trace$(O) : $(GENERAL_H_FILES) $(PMC_INC_DIR)/pmc/pmc_sub.h \
+        $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/debug$(O) : $(GENERAL_H_FILES) $(INC_DIR)/debugger.h \
-    $(SRC_DIR)/debug.str $(SRC_DIR)/pmc/pmc_key.h \
-    $(SRC_DIR)/pmc/pmc_continuation.h \
-    $(SRC_DIR)/pmc/pmc_context.h
+    $(SRC_DIR)/debug.str $(PMC_INC_DIR)/pmc/pmc_key.h \
+    $(PMC_INC_DIR)/pmc/pmc_continuation.h \
+    $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/sub$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/sub.str \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_continuation.h \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_continuation.h \
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/string/api$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/string/api.str \
         $(SRC_DIR)/string/private_cstring.h
@@ -1127,60 +1136,62 @@
 $(SRC_DIR)/longopt$(O) : $(GENERAL_H_FILES)
 
 $(SRC_DIR)/dynext$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/dynext.str \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/exceptions$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/exceptions.str \
-	$(SRC_DIR)/pmc/pmc_continuation.h \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_continuation.h \
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/events$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/events.str
 
-$(SRC_DIR)/thread$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_sub.h \
-	$(SRC_DIR)/pmc/pmc_parrotinterpreter.h
+$(SRC_DIR)/thread$(O) : $(GENERAL_H_FILES) $(PMC_INC_DIR)/pmc/pmc_sub.h \
+	$(PMC_INC_DIR)/pmc/pmc_parrotinterpreter.h
 
 $(SRC_DIR)/extend$(O) : $(GENERAL_H_FILES) $(INC_DIR)/extend.h \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/runcore/main$(O) : $(SRC_DIR)/runcore/main.c \
 	$(SRC_DIR)/runcore/main.str $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h \
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/runcore/profiling$(O) : $(SRC_DIR)/runcore/profiling.str $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_sub.h \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h \
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/call/args$(O) : $(SRC_DIR)/call/args.c $(GENERAL_H_FILES) \
 	$(SRC_DIR)/call/args.str \
-	$(SRC_DIR)/pmc/pmc_key.h $(SRC_DIR)/pmc/pmc_callsignature.h \
-	$(SRC_DIR)/pmc/pmc_fixedintegerarray.h $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_key.h $(PMC_INC_DIR)/pmc/pmc_callsignature.h \
+	$(PMC_INC_DIR)/pmc/pmc_fixedintegerarray.h $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/call/context_accessors$(O): $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/call/pcc$(O) : $(SRC_DIR)/call/pcc.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/call/pcc.str $(SRC_DIR)/pmc/pmc_fixedintegerarray.h \
-	$(SRC_DIR)/pmc/pmc_key.h $(SRC_DIR)/pmc/pmc_continuation.h \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(SRC_DIR)/call/pcc.str $(PMC_INC_DIR)/pmc/pmc_fixedintegerarray.h \
+	$(PMC_INC_DIR)/pmc/pmc_key.h $(PMC_INC_DIR)/pmc/pmc_continuation.h \
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/call/context$(O) : $(SRC_DIR)/call/context.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/interp/inter_cb$(O) : $(SRC_DIR)/interp/inter_cb.c \
 	$(GENERAL_H_FILES) $(SRC_DIR)/interp/inter_cb.str
 
 $(SRC_DIR)/interp/inter_misc$(O) : $(SRC_DIR)/interp/inter_misc.c \
 	$(GENERAL_H_FILES) $(SRC_DIR)/interp/inter_misc.str \
-        $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_context.h \
+	compilers/imcc/imc.h
 
 $(SRC_DIR)/interp/inter_create$(O) : $(SRC_DIR)/interp/inter_create.c \
 	$(GENERAL_H_FILES) $(SRC_DIR)/interp/inter_create.str \
-        $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_context.h \
+	compilers/imcc/imc.h
 
 $(SRC_DIR)/call/ops$(O) : $(SRC_DIR)/call/ops.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_continuation.h
+	$(PMC_INC_DIR)/pmc/pmc_continuation.h
 
-$(IO_DIR)/api$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h $(IO_DIR)/api.str $(SRC_DIR)/pmc/pmc_filehandle.h
+$(IO_DIR)/api$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h $(IO_DIR)/api.str $(PMC_INC_DIR)/pmc/pmc_filehandle.h
 
 $(IO_DIR)/buffer$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
 
@@ -1197,26 +1208,26 @@
 $(SRC_DIR)/main$(O) : $(SRC_DIR)/main.c $(GENERAL_H_FILES)
 
 $(SRC_DIR)/multidispatch$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/multidispatch.str \
-	$(SRC_DIR)/pmc/pmc_nci.h $(SRC_DIR)/pmc/pmc_sub.h \
-	$(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_nci.h $(PMC_INC_DIR)/pmc/pmc_sub.h \
+	$(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/packfile$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/packfile.str \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_key.h \
-        $(SRC_DIR)/pmc/pmc_context.h compilers/imcc/imc.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_key.h \
+        $(PMC_INC_DIR)/pmc/pmc_context.h compilers/imcc/imc.h
 
 $(PF_DIR)/pf_items$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/packout$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_key.h
+$(SRC_DIR)/packout$(O) : $(GENERAL_H_FILES) $(PMC_INC_DIR)/pmc/pmc_key.h
 
 $(SRC_DIR)/parrot$(O) : $(GENERAL_H_FILES)
 
 $(SRC_DIR)/runcore/cores$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/runcore/cores.str \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_context.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/tsq$(O) : $(GENERAL_H_FILES)
 
 $(SRC_DIR)/embed$(O) : $(GENERAL_H_FILES) $(INC_DIR)/debugger.h \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_context.h \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_context.h \
         compilers/imcc/imc.h
 
 $(SRC_DIR)/dataypes$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/dataypes.c
@@ -1225,32 +1236,32 @@
 
 $(SRC_DIR)/nci$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/nci.c $(SRC_DIR)/nci.str \
         $(SRC_DIR)/frame_builder.h \
-        $(SRC_DIR)/pmc/pmc_context.h \
-        $(SRC_DIR)/pmc/pmc_unmanagedstruct.h \
-        $(SRC_DIR)/pmc/pmc_managedstruct.h \
-        $(SRC_DIR)/pmc/pmc_nci.h \
-        $(SRC_DIR)/pmc/pmc_pointer.h
+        $(PMC_INC_DIR)/pmc/pmc_context.h \
+        $(PMC_INC_DIR)/pmc/pmc_unmanagedstruct.h \
+        $(PMC_INC_DIR)/pmc/pmc_managedstruct.h \
+        $(PMC_INC_DIR)/pmc/pmc_nci.h \
+        $(PMC_INC_DIR)/pmc/pmc_pointer.h
 
 $(SRC_DIR)/frame_builder$(O) : $(SRC_DIR)/frame_builder.h $(GENERAL_H_FILES) \
         $(SRC_DIR)/frame_builder.c \
         $(SRC_DIR)/frame_builder.str \
-        $(SRC_DIR)/pmc/pmc_fixedintegerarray.h \
-        $(SRC_DIR)/pmc/pmc_unmanagedstruct.h \
-        $(SRC_DIR)/pmc/pmc_managedstruct.h
+        $(PMC_INC_DIR)/pmc/pmc_fixedintegerarray.h \
+        $(PMC_INC_DIR)/pmc/pmc_unmanagedstruct.h \
+        $(PMC_INC_DIR)/pmc/pmc_managedstruct.h
 
 $(SRC_DIR)/vtables$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/vtables.c
 
 $(SRC_DIR)/gc/system$(O) : $(GENERAL_H_FILES)  $(SRC_DIR)/gc/gc_private.h
 
 $(SRC_DIR)/nci.c : $(SRC_DIR)/call_list.txt $(BUILD_TOOLS_DIR)/nativecall.pl \
-	$(SRC_DIR)/pmc/pmc_nci.h
+	$(PMC_INC_DIR)/pmc/pmc_nci.h
 	$(PERL) $(BUILD_TOOLS_DIR)/nativecall.pl $(SRC_DIR)/call_list.txt
 
-$(SRC_DIR)/warnings$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_context.h
+$(SRC_DIR)/warnings$(O) : $(GENERAL_H_FILES) $(PMC_INC_DIR)/pmc/pmc_context.h
 
 $(SRC_DIR)/misc$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/utils$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_nci.h
+$(SRC_DIR)/utils$(O) : $(GENERAL_H_FILES) $(PMC_INC_DIR)/pmc/pmc_nci.h
 
 $(SRC_DIR)/spf_render$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/spf_render.str
 
@@ -1270,12 +1281,12 @@
         $(SRC_DIR)/string/charset/unicode.h
 
 $(SRC_DIR)/pbc_merge$(O) : $(SRC_DIR)/pbc_merge.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_sub.h
+	$(PMC_INC_DIR)/pmc/pmc_sub.h
 
-$(IO_DIR)/filehandle$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/pmc_filehandle.h $(SRC_DIR)/io/io_private.h
+$(IO_DIR)/filehandle$(O) : $(INC_DIR)/parrot.h $(PMC_INC_DIR)/pmc/pmc_filehandle.h $(SRC_DIR)/io/io_private.h
 
 $(OPS_DIR)/core_ops$(O) : $(GENERAL_H_FILES) $(OPS_DIR)/core_ops.c \
-	$(SRC_DIR)/pmc/pmc_continuation.h $(SRC_DIR)/pmc/pmc_parrotlibrary.h
+	$(PMC_INC_DIR)/pmc/pmc_continuation.h $(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
 
 # core_ops depends upon config.h so that it gets updated along with
 # updates to config.h's version numbers
@@ -1286,11 +1297,11 @@
 $(OPS_DIR)/core_ops.c : $(OPS_FILES) $(BUILD_TOOLS_DIR)/ops2c.pl \
 	lib/Parrot/OpsFile.pm lib/Parrot/Op.pm $(INC_DIR)/config.h \
 	lib/Parrot/OpLib/core.pm lib/Parrot/OpTrans/C.pm \
-	$(SRC_DIR)/pmc/pmc_continuation.h
+	$(PMC_INC_DIR)/pmc/pmc_continuation.h
 	$(PERL) $(BUILD_TOOLS_DIR)/ops2c.pl C --core @no_lines_flag@
 
 $(OPS_DIR)/core_ops_switch$(O) : $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_switch.c \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
 
 $(INC_DIR)/oplib/core_ops_switch.h : $(OPS_DIR)/core_ops_switch.c
 
@@ -1704,7 +1715,7 @@
 	$(PERL) $(BUILD_TOOLS_DIR)/c2str.pl --init
 	$(RM_F) \
     $(STR_FILES) \
-    $(SRC_DIR)/string/private_cstring.h "src/pmc/*.c" "src/pmc/pmc_*.h" \
+    $(SRC_DIR)/string/private_cstring.h "src/pmc/*.c" "include/pmc/pmc_*.h" \
     "src/pmc/*.dump" vtable.dump "*.def" "*.lib" "*.exp"
 
 archclean: dynoplibs-clean dynpmc-clean dynext-clean
@@ -1902,7 +1913,7 @@
 
 sunlint :
 	rm -f *.ln
-	$(SUNLINT) $(CC_INC) "-Isrc/pmc" $(SUNLINTOPTS) $(LINTABLE_CFILES)
+	$(SUNLINT) $(CC_INC) "-Iinclude/pmc" $(SUNLINTOPTS) $(LINTABLE_CFILES)
 
 BSD_LINT_FLAGS := -a -aa -b -c -e -h -n -p -r -u -x -z -F -H -V
 
@@ -1921,7 +1932,7 @@
 
 bsdlint : $(PARROT)
 	rm -f *.ln
-	$(LINT) $(CC_INC) "-Isrc/pmc" $(BSD_LINT_FLAGS) $(BSD_LINT_EXCLUSIONS) $(LINTABLE_CFILES)
+	$(LINT) $(CC_INC) "-Iinclude/pmc" $(BSD_LINT_FLAGS) $(BSD_LINT_EXCLUSIONS) $(LINTABLE_CFILES)
 
 # For checking with splint see also http:////www.perlfoundation.org//parrot//index.cgi?splint
 # Splint: http:////splint.org
@@ -2062,7 +2073,7 @@
 
 splint-all : $(PARROT)
 	$(MKPATH) $(SPLINT_TMP)
-	$(SPLINT) $(CC_INC) "-Isrc/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
+	$(SPLINT) $(CC_INC) "-Iinclude/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
 	$(SPLINT_SOURCE) \
 	$(SPLINT) $(CC_INC) $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) $(IMCC_DIR)/main.c
 
@@ -2073,7 +2084,7 @@
 
 splint : all
 	$(MKPATH) $(SPLINT_TMP)
-	$(SPLINT) $(CC_INC) "-Isrc/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
+	$(SPLINT) $(CC_INC) "-Iinclude/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
 	+partial -DNDEBUG \
 	$(SPLINT_SOURCE) \
 		| grep -v 'Source code error generation point'

Modified: trunk/config/init/defaults.pm
==============================================================================
--- trunk/config/init/defaults.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/init/defaults.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -136,7 +136,7 @@
 
         libs => $Config{libs},
 
-        cc_inc     => "-I./include",
+        cc_inc     => "-I./include -I./include/pmc",
         cc_debug   => '-g',
         link_debug => '',
 

Modified: trunk/config/inter/charset.pm
==============================================================================
--- trunk/config/inter/charset.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/inter/charset.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -68,7 +68,7 @@
     foreach my $charset ( split( /\s+/, $charset_list ) ) {
         $charset =~ s/\.c$//;
         $TEMP_charset_build .= <<END
-src/string/charset/$charset\$(O): src/string/charset/$charset.h src/string/charset/ascii.h src/string/charset/$charset.c \$(NONGEN_HEADERS)
+src/string/charset/$charset\$(O): src/string/charset/$charset.h src/string/charset/ascii.h src/string/charset/$charset.c src/string/charset/tables.h \$(NONGEN_HEADERS)
 
 
 END

Modified: trunk/config/inter/encoding.pm
==============================================================================
--- trunk/config/inter/encoding.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/config/inter/encoding.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -68,7 +68,7 @@
     foreach my $encoding ( split( /\s+/, $encoding_list ) ) {
         $encoding =~ s/\.c$//;
         $TEMP_encoding_build .= <<END
-src/string/encoding/$encoding\$(O): src/string/encoding/$encoding.h src/string/encoding/$encoding.c \$(NONGEN_HEADERS)
+src/string/encoding/$encoding\$(O): src/string/encoding/$encoding.h src/string/encoding/$encoding.c src/string/unicode.h \$(NONGEN_HEADERS)
 
 
 END

Modified: trunk/include/parrot/context.h
==============================================================================
--- trunk/include/parrot/context.h	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/include/parrot/context.h	Thu Nov 12 09:49:10 2009	(r42440)
@@ -24,13 +24,7 @@
     INTVAL       *regs_i;
 } Regs_ni;
 
-/* Ugly cheat to include Context definition for installed parrot. Directory
- * structure is sooo different and there is no way to include pmc_context.h in
- * sane way.
- */
-#ifndef PARROT_IN_CORE
-#  include "pmc/pmc_context.h"
-#endif
+#include <pmc/pmc_context.h>
 typedef struct Parrot_Context_attributes Parrot_Context;
 
 /*

Added: trunk/include/pmc/dummy
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/include/pmc/dummy	Thu Nov 12 09:49:10 2009	(r42440)
@@ -0,0 +1 @@
+Dummy file to keep directory.

Modified: trunk/lib/Parrot/OpTrans/C.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/C.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/lib/Parrot/OpTrans/C.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -52,7 +52,7 @@
 sub defines {
     my $type = __PACKAGE__;
     return <<END;
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 
 /* defines - $0 -> $type */
 #undef CONST

Modified: trunk/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- trunk/lib/Parrot/Ops2c/Utils.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/lib/Parrot/Ops2c/Utils.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -550,8 +550,8 @@
     print $fh $self->{preamble};
     print $fh <<END_C;
 #include "$self->{include}"
-#include "../pmc/pmc_parrotlibrary.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_context.h"
 
 $self->{defines}
 

Modified: trunk/lib/Parrot/Pmc2c/PMC.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMC.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/lib/Parrot/Pmc2c/PMC.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -225,9 +225,9 @@
 }
 
 sub filename {
-    my ( $self, $type ) = @_;
+    my ( $self, $type, $is_dynamic ) = @_;
     return $self->{filename} unless $type;
-    return Parrot::Pmc2c::UtilFunctions::filename( $self->{filename}, $type );
+    return Parrot::Pmc2c::UtilFunctions::filename( $self->{filename}, $type, $is_dynamic );
 }
 
 sub get_flags {

Modified: trunk/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMCEmitter.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/lib/Parrot/Pmc2c/PMCEmitter.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -50,7 +50,7 @@
     $emitter->write_to_file;
 
     $emitter = $self->{emitter} =
-        Parrot::Pmc2c::Emitter->new( $self->filename(".h") );
+        Parrot::Pmc2c::Emitter->new( $self->filename(".h", $self->is_dynamic) );
 
     $self->generate_h_file;
     $emitter->write_to_file;
@@ -76,8 +76,8 @@
     $self->gen_includes;
 
     # The PCC code needs Continuation-related macros from these headers.
-    $c->emit("#include \"pmc_continuation.h\"\n");
-    $c->emit("#include \"pmc_context.h\"\n");
+    $c->emit("#include \"pmc/pmc_continuation.h\"\n");
+    $c->emit("#include \"pmc/pmc_context.h\"\n");
 
     $c->emit( $self->preamble );
 
@@ -91,7 +91,7 @@
         $ro->gen_methods;
     }
 
-    $c->emit("#include \"pmc_default.h\"\n");
+    $c->emit("#include \"pmc/pmc_default.h\"\n");
 
     $c->emit( $self->update_vtable_func );
     $c->emit( $self->get_vtable_func );

Modified: trunk/lib/Parrot/Pmc2c/UtilFunctions.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/UtilFunctions.pm	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/lib/Parrot/Pmc2c/UtilFunctions.pm	Thu Nov 12 09:49:10 2009	(r42440)
@@ -275,9 +275,17 @@
 }
 
 sub filename {
-    my ( $filename, $type ) = @_;
+    my ( $filename, $type, $is_dynamic ) = @_;
 
-    $filename =~ s/(\w+)\.\w+$/pmc_$1.h/ if ( $type eq ".h" );
+    # Core PMC emit header files inside include/pmc. All others in original directory
+    if ($type eq '.h') {
+        if (defined ($is_dynamic) && $is_dynamic) {
+            $filename =~ s{(\w+)\.\w+$}{pmc_$1.h};
+        }
+        else {
+            $filename =~ s{(?:.*/)?(\w+)\.\w+$}{include/pmc/pmc_$1.h};
+        }
+    }
     $filename =~ s/\.\w+$/.c/            if ( $type eq ".c" );
     $filename =~ s/\.\w+$/.dump/         if ( $type eq ".dump" );
     $filename =~ s/\.\w+$/.pmc/          if ( $type eq ".pmc" );

Modified: trunk/src/call/args.c
==============================================================================
--- trunk/src/call/args.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/call/args.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -21,10 +21,10 @@
 #include "parrot/oplib/ops.h"
 #include "parrot/runcore_api.h"
 #include "args.str"
-#include "../pmc/pmc_key.h"
-#include "../pmc/pmc_callsignature.h"
-#include "../pmc/pmc_fixedintegerarray.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_key.h"
+#include "pmc/pmc_callsignature.h"
+#include "pmc/pmc_fixedintegerarray.h"
+#include "pmc/pmc_context.h"
 
 /* HEADERIZER HFILE: include/parrot/call.h */
 

Modified: trunk/src/call/context.c
==============================================================================
--- trunk/src/call/context.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/call/context.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -14,8 +14,8 @@
 
 #include "parrot/parrot.h"
 #include "parrot/call.h"
-#include "../pmc/pmc_sub.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_context.h"
 
 /*
 

Modified: trunk/src/call/context_accessors.c
==============================================================================
--- trunk/src/call/context_accessors.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/call/context_accessors.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -14,7 +14,7 @@
 
 #include "parrot/parrot.h"
 #include "parrot/call.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 
 #ifndef NDEBUG
 

Modified: trunk/src/call/ops.c
==============================================================================
--- trunk/src/call/ops.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/call/ops.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
 
 #include "parrot/parrot.h"
 #include "parrot/oplib/ops.h"
-#include "../pmc/pmc_continuation.h"
+#include "pmc/pmc_continuation.h"
 
 /* HEADERIZER HFILE: include/parrot/call.h */
 

Modified: trunk/src/call/pcc.c
==============================================================================
--- trunk/src/call/pcc.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/call/pcc.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -21,9 +21,9 @@
 #include "parrot/oplib/ops.h"
 #include "parrot/runcore_api.h"
 #include "pcc.str"
-#include "../pmc/pmc_key.h"
-#include "../pmc/pmc_continuation.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_key.h"
+#include "pmc/pmc_continuation.h"
+#include "pmc/pmc_context.h"
 
 /* HEADERIZER HFILE: include/parrot/call.h */
 

Modified: trunk/src/interp/inter_create.c
==============================================================================
--- trunk/src/interp/inter_create.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/interp/inter_create.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -23,7 +23,7 @@
 #include "parrot/runcore_api.h"
 #include "parrot/oplib/core_ops.h"
 #include "../compilers/imcc/imc.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 #include "inter_create.str"
 
 /* HEADERIZER HFILE: include/parrot/interpreter.h */

Modified: trunk/src/interp/inter_misc.c
==============================================================================
--- trunk/src/interp/inter_misc.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/interp/inter_misc.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -23,7 +23,7 @@
 #include "inter_misc.str"
 #include "../compilers/imcc/imc.h"
 #include "parrot/runcore_api.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_context.h"
 
 #include "parrot/has_header.h"
 

Modified: trunk/src/io/api.c
==============================================================================
--- trunk/src/io/api.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/io/api.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -30,8 +30,8 @@
 #include "parrot/parrot.h"
 #include "io_private.h"
 #include "api.str"
-#include "../pmc/pmc_filehandle.h"
-#include "../pmc/pmc_stringhandle.h"
+#include "pmc/pmc_filehandle.h"
+#include "pmc/pmc_stringhandle.h"
 
 #include <stdarg.h>
 

Modified: trunk/src/io/filehandle.c
==============================================================================
--- trunk/src/io/filehandle.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/io/filehandle.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -17,7 +17,7 @@
 
 #include "parrot/parrot.h"
 #include "io_private.h"
-#include "../pmc/pmc_filehandle.h"
+#include "pmc/pmc_filehandle.h"
 
 /* HEADERIZER HFILE: include/parrot/io.h */
 

Modified: trunk/src/io/socket_api.c
==============================================================================
--- trunk/src/io/socket_api.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/io/socket_api.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -21,7 +21,7 @@
 #include "parrot/parrot.h"
 #include "io_private.h"
 #include "api.str"
-#include "../pmc/pmc_socket.h"
+#include "pmc/pmc_socket.h"
 
 #include <stdarg.h>
 

Modified: trunk/src/io/socket_unix.c
==============================================================================
--- trunk/src/io/socket_unix.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/io/socket_unix.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -30,7 +30,7 @@
 
 #include "parrot/parrot.h"
 #include "io_private.h"
-#include "../pmc/pmc_socket.h"
+#include "pmc/pmc_socket.h"
 
 #ifdef PIO_OS_UNIX
 

Modified: trunk/src/io/socket_win32.c
==============================================================================
--- trunk/src/io/socket_win32.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/io/socket_win32.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -28,7 +28,7 @@
 
 #include "parrot/parrot.h"
 #include "io_private.h"
-#include "../pmc/pmc_socket.h"
+#include "pmc/pmc_socket.h"
 
 #ifdef PIO_OS_WIN32
 

Modified: trunk/src/pmc/addrregistry.pmc
==============================================================================
--- trunk/src/pmc/addrregistry.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/addrregistry.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -27,7 +27,7 @@
 
 /* included manually to prevent breaking C++ builds -- see RT #56534 */
 #include "parrot/hash.h"
-#include "pmc_hash.h"
+#include "pmc/pmc_hash.h"
 
 pmclass AddrRegistry extends Hash provides hash auto_attrs {
 /*

Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/class.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -91,8 +91,8 @@
 
 #define PARROT_IN_OBJECTS_C /* To get the vtable.h imports we want. */
 #include "parrot/oo_private.h"
-#include "pmc_object.h"
-#include "pmc_namespace.h"
+#include "pmc/pmc_object.h"
+#include "pmc/pmc_namespace.h"
 
 static int
 cache_class_attribs(PARROT_INTERP, PMC *cur_class, PMC *attrib_index,

Modified: trunk/src/pmc/context.pmc
==============================================================================
--- trunk/src/pmc/context.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/context.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -21,7 +21,7 @@
 
 
 #include "parrot/packfile.h"
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 pmclass Context auto_attrs {
     ATTR PMC     *caller_ctx;      /* caller context */

Modified: trunk/src/pmc/continuation.pmc
==============================================================================
--- trunk/src/pmc/continuation.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/continuation.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -22,7 +22,7 @@
 
 
 #include "parrot/oplib/ops.h"
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 /*
 

Modified: trunk/src/pmc/eval.pmc
==============================================================================
--- trunk/src/pmc/eval.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/eval.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
 
 */
 
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 static void
 clear_fixups(PARROT_INTERP, Parrot_Sub_attributes *sub_data)

Modified: trunk/src/pmc/exception.pmc
==============================================================================
--- trunk/src/pmc/exception.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/exception.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -50,7 +50,7 @@
 */
 
 #include "parrot/exceptions.h"
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 pmclass Exception auto_attrs {
 

Modified: trunk/src/pmc/hash.pmc
==============================================================================
--- trunk/src/pmc/hash.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/hash.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -44,9 +44,9 @@
 
 */
 
-#include "pmc_iterator.h"
-#include "pmc_key.h"
-#include "pmc_hashiteratorkey.h"
+#include "pmc/pmc_iterator.h"
+#include "pmc/pmc_key.h"
+#include "pmc/pmc_hashiteratorkey.h"
 
 pmclass Hash provides hash auto_attrs {
     ATTR Hash *hash;

Modified: trunk/src/pmc/hashiterator.pmc
==============================================================================
--- trunk/src/pmc/hashiterator.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/hashiterator.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -46,8 +46,8 @@
 
 */
 
-#include "pmc_hash.h"
-#include "pmc_hashiteratorkey.h"
+#include "pmc/pmc_hash.h"
+#include "pmc/pmc_hashiteratorkey.h"
 
 /*
 

Modified: trunk/src/pmc/integer.pmc
==============================================================================
--- trunk/src/pmc/integer.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/integer.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
 
 */
 
-#include "pmc_bigint.h"
+#include "pmc/pmc_bigint.h"
 
 static void
 maybe_throw_overflow_error(PARROT_INTERP)

Modified: trunk/src/pmc/lexinfo.pmc
==============================================================================
--- trunk/src/pmc/lexinfo.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/lexinfo.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
 */
 
 /* included manually to prevent breaking C++ builds -- see RT #56534*/
-#include "pmc_hash.h"
+#include "pmc/pmc_hash.h"
 
 /*
  * LexInfo contains a constant Hash with constant string

Modified: trunk/src/pmc/multisub.pmc
==============================================================================
--- trunk/src/pmc/multisub.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/multisub.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
 
 */
 
-#include "pmc_context.h"
+#include "pmc/pmc_context.h"
 
 pmclass MultiSub extends ResizablePMCArray auto_attrs provides array {
 

Modified: trunk/src/pmc/namespace.pmc
==============================================================================
--- trunk/src/pmc/namespace.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/namespace.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -18,7 +18,7 @@
 
 */
 
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 static void add_to_class(
         Interp *interp,

Modified: trunk/src/pmc/object.pmc
==============================================================================
--- trunk/src/pmc/object.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/object.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
 */
 
 #include "parrot/oo_private.h"
-#include "pmc_class.h"
+#include "pmc/pmc_class.h"
 
 /* This finds the index of an attribute in an object's attribute store and
  * returns it. Returns -1 if the attribute does not exist. */

Modified: trunk/src/pmc/orderedhashiterator.pmc
==============================================================================
--- trunk/src/pmc/orderedhashiterator.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/orderedhashiterator.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -18,8 +18,8 @@
 
 */
 
-#include "pmc_hash.h"
-#include "pmc_hashiteratorkey.h"
+#include "pmc/pmc_hash.h"
+#include "pmc/pmc_hashiteratorkey.h"
 
 pmclass OrderedHashIterator extends Iterator no_ro auto_attrs {
     ATTR PMC        *pmc_hash;      /* the Hash which this Iterator iterates */

Modified: trunk/src/pmc/packfile.pmc
==============================================================================
--- trunk/src/pmc/packfile.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/packfile.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
 
 */
 
-#include "pmc_packfiledirectory.h"
+#include "pmc/pmc_packfiledirectory.h"
 
 /*
 Copy attributes from PackFile* to Packfile PMC.

Modified: trunk/src/pmc/packfileannotations.pmc
==============================================================================
--- trunk/src/pmc/packfileannotations.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/packfileannotations.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -27,7 +27,7 @@
 
 */
 
-#include "pmc_packfileannotation.h"
+#include "pmc/pmc_packfileannotation.h"
 
 pmclass PackfileAnnotations auto_attrs extends PackfileSegment {
     /* ConstantTable used for names lookup */

Modified: trunk/src/pmc/parrotinterpreter.pmc
==============================================================================
--- trunk/src/pmc/parrotinterpreter.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/parrotinterpreter.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -29,8 +29,8 @@
 #include "parrot/dynext.h"
 #include "parrot/io.h"
 #include "parrot/runcore_api.h"
-#include "pmc_class.h"
-#include "pmc_sub.h"
+#include "pmc/pmc_class.h"
+#include "pmc/pmc_sub.h"
 
 #define PMC_interp(x) ((Parrot_ParrotInterpreter_attributes *)PMC_data(x))->interp
 #define PMC_args(x)   ((Parrot_ParrotInterpreter_attributes *)PMC_data(x))->args

Modified: trunk/src/pmc/role.pmc
==============================================================================
--- trunk/src/pmc/role.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/role.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -48,7 +48,7 @@
 
 */
 
-#include "pmc_namespace.h"
+#include "pmc/pmc_namespace.h"
 
 /* Takes a hash and initializes the role based on it. */
 static void init_role_from_hash(PARROT_INTERP, PMC *self, PMC *info)

Modified: trunk/src/pmc/scalar.pmc
==============================================================================
--- trunk/src/pmc/scalar.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/scalar.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -18,7 +18,7 @@
 
 */
 
-#include "pmc_bigint.h"
+#include "pmc/pmc_bigint.h"
 
 static PMC *
 bitwise_left_shift_internal(PARROT_INTERP, PMC *self,

Modified: trunk/src/pmc/undef.pmc
==============================================================================
--- trunk/src/pmc/undef.pmc	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/pmc/undef.pmc	Thu Nov 12 09:49:10 2009	(r42440)
@@ -23,7 +23,7 @@
 
 */
 
-#include "pmc_object.h"
+#include "pmc/pmc_object.h"
 #define UNDEF_STRING_CLASS enum_class_String
 
 pmclass Undef no_ro {

Modified: trunk/src/runcore/cores.c
==============================================================================
--- trunk/src/runcore/cores.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/runcore/cores.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -248,8 +248,8 @@
 #include "parrot/oplib/core_ops_switch.h"
 #include "parrot/dynext.h"
 
-#include "../pmc/pmc_sub.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_context.h"
 
 #ifdef HAVE_COMPUTED_GOTO
 #  include "parrot/oplib/core_ops_cg.h"

Modified: trunk/src/runcore/main.c
==============================================================================
--- trunk/src/runcore/main.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/runcore/main.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -45,8 +45,8 @@
 #  include "parrot/oplib/core_ops_cgp.h"
 #endif
 #include "parrot/dynext.h"
-#include "../pmc/pmc_parrotlibrary.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_context.h"
 
 
 /* HEADERIZER HFILE: include/parrot/runcore_api.h */

Modified: trunk/src/runcore/profiling.c
==============================================================================
--- trunk/src/runcore/profiling.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/runcore/profiling.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -17,8 +17,8 @@
 
 #include "profiling.str"
 
-#include "../pmc/pmc_sub.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_context.h"
 
 #ifdef WIN32
 #  define getpid _getpid

Modified: trunk/src/runcore/trace.c
==============================================================================
--- trunk/src/runcore/trace.c	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/src/runcore/trace.c	Thu Nov 12 09:49:10 2009	(r42440)
@@ -25,8 +25,8 @@
 
 #include "parrot/runcore_trace.h"
 #include "parrot/oplib/ops.h"
-#include "../pmc/pmc_sub.h"
-#include "../pmc/pmc_context.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_context.h"
 
 /* HEADERIZER HFILE: include/parrot/runcore_trace.h */
 

Modified: trunk/t/tools/pmc2cutils/05-gen_c.t
==============================================================================
--- trunk/t/tools/pmc2cutils/05-gen_c.t	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/t/tools/pmc2cutils/05-gen_c.t	Thu Nov 12 09:49:10 2009	(r42440)
@@ -19,7 +19,7 @@
     }
     unshift @INC, qq{$topdir/lib};
 }
-use Test::More tests => 44;
+use Test::More tests => 52;
 use Carp;
 use File::Basename;
 use File::Copy;
@@ -44,7 +44,7 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
 
     my $temppmcdir = qq{$tdir/src/pmc};
-    for ( qq{$tdir/src}, $temppmcdir ) {
+    for ( qq{$tdir/src}, qq{$tdir/include}, qq{$tdir/include/pmc}, $temppmcdir ) {
         ok( mkdir($_), "created $_ under tempdir" );
     }
 
@@ -87,6 +87,8 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include} ), "created include/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include/pmc} ), "created include/pmc/ under tempdir" );
     my $temppmcdir = qq{$tdir/src/pmc};
     ok( ( mkdir $temppmcdir ), "created src/pmc/ under tempdir" );
 
@@ -139,6 +141,8 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include} ), "created include/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include/pmc} ), "created include/pmc/ under tempdir" );
     my $temppmcdir = qq{$tdir/src/pmc};
     ok( ( mkdir $temppmcdir ), "created src/pmc/ under tempdir" );
 
@@ -190,6 +194,8 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include} ), "created include/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include/pmc} ), "created include/pmc/ under tempdir" );
     my $temppmcdir = qq{$tdir/src/pmc};
     ok( ( mkdir $temppmcdir ), "created src/pmc/ under tempdir" );
 

Modified: trunk/tools/dev/checkdepend.pl
==============================================================================
--- trunk/tools/dev/checkdepend.pl	Thu Nov 12 08:10:32 2009	(r42439)
+++ trunk/tools/dev/checkdepend.pl	Thu Nov 12 09:49:10 2009	(r42440)
@@ -22,6 +22,7 @@
 
 =cut
 
+# TODO Unskip pmc generated files.
 my $files = `ack -fa . | grep '\\.c\$'`;
 
 my %deps;
@@ -48,6 +49,7 @@
 }
 $rules =~ s/\\\n/ /g;
 $rules =~ s/\Q$(SRC_DIR)\E/src/g;
+$rules =~ s/\Q$(PMC_INC_DIR)\E/include/g;
 $rules =~ s/\Q$(O)\E//g;
 
 foreach my $file (keys %deps) {
@@ -61,23 +63,28 @@
     {
         $declared =~ s/\s+/ /g;
         foreach my $inc (@{$deps{$file}}) {
+            # Skip #include "parrot/foo.h". It's in GENERAL_H_FILES rule.
+            next if $inc =~ m{^parrot/}o;
+
             # incs can be relative, but makefile is from top level
             my $file_dir = (File::Spec->splitpath($file))[1];
             my $make_dep = collapse_path(File::Spec->catfile($file_dir,$inc));
 
-            if (! defined $make_dep) {
-                # this means we didn't construct the right relative path.
-                # probably looking in include/ instead of  .
-                diag "skipping $inc...\n";
-                next;
-            }
-
-            if ($declared !~ /\b\Q$make_dep\E\b/) {
-              # this isn't the actual comparison, just to give nice output
-              # on failure.
-              is($declared,$inc,$file);
-              $failed = 1;
-            }
+            # If it's include from src
+            next if defined($make_dep) && ($declared =~ /\b\Q$make_dep\E\b/);
+
+            # Try to costruct "global" include
+            $make_dep = collapse_path(File::Spec->catfile('include', $inc));
+            next if defined($make_dep) && ($declared =~ /\b\Q$make_dep\E\b/);
+
+            # Try to costruct "pmc" include
+            $make_dep = collapse_path(File::Spec->catfile('include', 'pmc', $inc));
+            next if defined($make_dep) && ($declared =~ /\b\Q$make_dep\E\b/);
+
+            # this isn't the actual comparison, just to give nice output
+            # on failure.
+            is($inc, $declared, $file);
+            $failed = 1;
         }
     }
     pass("$file has proper deps") unless $failed;


More information about the parrot-commits mailing list