cvsuser     04/10/11 03:44:33

  Modified:    build_tools parrot_config_c.pl
               config/gen/makefiles root.in
               src      library.c
  Log:
  runtime prefix 7 - ignore prefix if PARROT_TEST is in env
  
  Revision  Changes    Path
  1.3       +3 -26     parrot/build_tools/parrot_config_c.pl
  
  Index: parrot_config_c.pl
  ===================================================================
  RCS file: /cvs/public/parrot/build_tools/parrot_config_c.pl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -r1.2 -r1.3
  --- parrot_config_c.pl        7 Oct 2004 13:36:48 -0000       1.2
  +++ parrot_config_c.pl        11 Oct 2004 10:44:28 -0000      1.3
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: parrot_config_c.pl,v 1.2 2004/10/07 13:36:48 leo Exp $
  +# $Id: parrot_config_c.pl,v 1.3 2004/10/11 10:44:28 leo Exp $
   
   =head1 NAME
   
  @@ -8,11 +8,11 @@
   
   =head1 SYNOPSIS
   
  -    % perl build_tools/parrot_config_c.pl > src/parrot_config.c
  +    % perl build_tools/parrot_config_c.pl > src/parrot_config.h
   
   =head1 DESCRIPTION
   
  -Create F<src/parrot_config.c> with relevant runtime information like install
  +Create F<src/parrot_config.h> with relevant runtime information like install
   prefix.
   
   =cut
  @@ -35,31 +35,8 @@
    *
    */
   
  -#include <parrot/parrot.h>
  -
   static const char* runtime_prefix = \"$prefix\";
   
  -const char*
  -Parrot_get_runtime_prefix(Interp *interpreter, STRING **prefix_str)
  -{
  -    static STRING *s;
  -    static int init_done;
  -    static const char *prefix;
  -
  -    if (!*runtime_prefix)
  -     return NULL;
  -    if (!init_done) {
  -     init_done = 1;
  -     prefix = runtime_prefix;
  -     s = const_string(interpreter, runtime_prefix);
  -     if (!Parrot_stat_info_intval(interpreter, s, STAT_EXISTS))
  -         prefix = NULL;
  -    }
  -    if (prefix_str)
  -     *prefix_str = s;
  -    return prefix;
  -}
  -
   EOF
   
   
  
  
  
  1.252     +6 -5      parrot/config/gen/makefiles/root.in
  
  Index: root.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
  retrieving revision 1.251
  retrieving revision 1.252
  diff -u -w -r1.251 -r1.252
  --- root.in   8 Oct 2004 11:14:56 -0000       1.251
  +++ root.in   11 Oct 2004 10:44:32 -0000      1.252
  @@ -1,4 +1,4 @@
  -# $Id: root.in,v 1.251 2004/10/08 11:14:56 leo Exp $
  +# $Id: root.in,v 1.252 2004/10/11 10:44:32 leo Exp $
   
   ###############################################################################
   #
  @@ -161,13 +161,13 @@
       $(INC)/vtable.h \
       $(INC)/oplib/core_ops.h \
       $(INC)/oplib/core_ops_prederef.h \
  +    $(SRC)/parrot_config.h \
       $(INC)/oplib/core_ops_switch.h
   
   GEN_SOURCES = \
       $(SRC)/core_ops.c \
       $(SRC)/core_ops_prederef.c  \
       $(SRC)/fingerprint.c \
  -    $(SRC)/parrot_config.c \
       $(SRC)/nci.c \
       $(SRC)/core_ops_switch.c \
       $(SRC)/jit_cpu.c \
  @@ -341,7 +341,6 @@
       $(SRC)/spf_vtable$(O) \
       $(SRC)/datatypes$(O) \
       $(SRC)/fingerprint$(O) \
  -    $(SRC)/parrot_config$(O) \
       $(SRC)/nci$(O) \
       $(SRC)/cpu_dep$(O) \
       $(SRC)/tsq$(O) \
  @@ -679,8 +678,8 @@
   $(SRC)/fingerprint.c : $(BUILD_TOOL)/fingerprint_c.pl PBC_COMPAT
        $(PERL) $(BUILD_TOOL)/fingerprint_c.pl > $(SRC)/fingerprint.c
   
  -$(SRC)/parrot_config.c : $(BUILD_TOOL)/parrot_config_c.pl config_lib.pasm
  -     $(PERL) $(BUILD_TOOL)/parrot_config_c.pl > $(SRC)/parrot_config.c
  +$(SRC)/parrot_config.h : $(BUILD_TOOL)/parrot_config_c.pl config_lib.pasm
  +     $(PERL) $(BUILD_TOOL)/parrot_config_c.pl > $(SRC)/parrot_config.h
   
   ###############################################################################
   #
  @@ -737,6 +736,8 @@
   
   $(SRC)/list$(O) : $(GENERAL_H_FILES)
   
  +$(SRC)/library$(O) : $(GENERAL_H_FILES) src/parrot_config.h
  +
   $(SRC)/jit$(O) : $(GENERAL_H_FILES) ${TEMP_jit_h} $(INC)/jit_emit.h
   
   $(SRC)/jit_debug$(O) : $(GENERAL_H_FILES) ${TEMP_jit_h}
  
  
  
  1.11      +33 -1     parrot/src/library.c
  
  Index: library.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/library.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- library.c 7 Oct 2004 14:48:15 -0000       1.10
  +++ library.c 11 Oct 2004 10:44:32 -0000      1.11
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  -$Id: library.c,v 1.10 2004/10/07 14:48:15 leo Exp $
  +$Id: library.c,v 1.11 2004/10/11 10:44:32 leo Exp $
   
   =head1 NAME
   
  @@ -22,6 +22,8 @@
   #include <assert.h>
   #include "library.str"
   
  +#include "parrot_config.h"
  +
   #if 0
   /*
   
  @@ -244,6 +246,36 @@
       return NULL;
   }
   
  +const char*
  +Parrot_get_runtime_prefix(Interp *interpreter, STRING **prefix_str)
  +{
  +    static STRING *s;
  +    static int init_done;
  +    static const char *prefix;
  +    int free_env;
  +    char *env;
  +
  +    if (!*runtime_prefix)
  +     return NULL;
  +    if (!init_done) {
  +     init_done = 1;
  +     prefix = runtime_prefix;
  +     s = const_string(interpreter, runtime_prefix);
  +     if (!Parrot_stat_info_intval(interpreter, s, STAT_EXISTS))
  +         prefix = NULL;
  +        env = Parrot_getenv("PARROT_TEST", &free_env);
  +        if (env) {
  +            prefix = NULL;
  +            if (free_env)
  +                mem_sys_free(env);
  +        }
  +        if (!prefix)
  +            s = NULL;
  +    }
  +    if (prefix_str)
  +     *prefix_str = s;
  +    return prefix;
  +}
   /*
   
   =back
  
  
  

Reply via email to