2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

The 'path.exists' rule is now native.

[SVN r21201]
This commit is contained in:
Vladimir Prus
2003-12-10 08:27:21 +00:00
parent d205f1b942
commit b03372ac97
11 changed files with 71 additions and 6 deletions

View File

@@ -319,7 +319,7 @@ set BJAM_SOURCES=%BJAM_SOURCES% hdrmacro.c headers.c jam.c jambase.c jamgram.c l
set BJAM_SOURCES=%BJAM_SOURCES% newstr.c option.c parse.c pathunix.c pathvms.c regexp.c
set BJAM_SOURCES=%BJAM_SOURCES% rules.c scan.c search.c subst.c timestamp.c variable.c modules.c
set BJAM_SOURCES=%BJAM_SOURCES% strings.c filesys.c builtins.c pwd.c class.c w32_getreg.c native.c
set BJAM_SOURCES=%BJAM_SOURCES% modules/set.c
set BJAM_SOURCES=%BJAM_SOURCES% modules/set.c modules/path.c
@echo ON
rd /S /Q bootstrap.%BOOST_JAM_TOOLSET%

View File

@@ -275,7 +275,8 @@ jam.source =
option.c parse.c regexp.c rules.c
scan.c search.c subst.c
timestamp.c variable.c modules.c strings.c filesys.c
builtins.c pwd.c class.c native.c modules/set.c
builtins.c pwd.c class.c native.c modules/set.c
modules/path.c
;
if $(NT)
{

View File

@@ -191,7 +191,8 @@ BJAM_SOURCES="\
hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c\
newstr.c option.c parse.c pathunix.c pathvms.c regexp.c\
rules.c scan.c search.c subst.c timestamp.c variable.c modules.c\
strings.c filesys.c builtins.c pwd.c class.c native.c modules/set.c"
strings.c filesys.c builtins.c pwd.c class.c native.c modules/set.c\
modules/path.c"
echo_run rm -rf bootstrap.$BOOST_JAM_TOOLSET
echo_run mkdir bootstrap.$BOOST_JAM_TOOLSET

View File

@@ -273,6 +273,7 @@ load_builtins()
/* Initialize builtin modules */
init_set();
init_path();
}
/*

View File

@@ -0,0 +1,29 @@
#include "../native.h"
#include "../timestamp.h"
#include "../newstr.h"
LIST *path_exists( PARSE *parse, FRAME *frame )
{
LIST* l = lol_get( frame->args, 0 );
time_t time;
timestamp(l->string, &time);
if (time != 0)
{
return list_new(0, newstr("true"));
}
else
{
return L0;
}
}
void init_path()
{
{
char* args[] = { "location", 0 };
declare_native_rule("path", "exists", args, path_exists);
}
}

View File

@@ -319,7 +319,7 @@ set BJAM_SOURCES=%BJAM_SOURCES% hdrmacro.c headers.c jam.c jambase.c jamgram.c l
set BJAM_SOURCES=%BJAM_SOURCES% newstr.c option.c parse.c pathunix.c pathvms.c regexp.c
set BJAM_SOURCES=%BJAM_SOURCES% rules.c scan.c search.c subst.c timestamp.c variable.c modules.c
set BJAM_SOURCES=%BJAM_SOURCES% strings.c filesys.c builtins.c pwd.c class.c w32_getreg.c native.c
set BJAM_SOURCES=%BJAM_SOURCES% modules/set.c
set BJAM_SOURCES=%BJAM_SOURCES% modules/set.c modules/path.c
@echo ON
rd /S /Q bootstrap.%BOOST_JAM_TOOLSET%

View File

@@ -275,7 +275,8 @@ jam.source =
option.c parse.c regexp.c rules.c
scan.c search.c subst.c
timestamp.c variable.c modules.c strings.c filesys.c
builtins.c pwd.c class.c native.c modules/set.c
builtins.c pwd.c class.c native.c modules/set.c
modules/path.c
;
if $(NT)
{

View File

@@ -191,7 +191,8 @@ BJAM_SOURCES="\
hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c\
newstr.c option.c parse.c pathunix.c pathvms.c regexp.c\
rules.c scan.c search.c subst.c timestamp.c variable.c modules.c\
strings.c filesys.c builtins.c pwd.c class.c native.c modules/set.c"
strings.c filesys.c builtins.c pwd.c class.c native.c modules/set.c\
modules/path.c"
echo_run rm -rf bootstrap.$BOOST_JAM_TOOLSET
echo_run mkdir bootstrap.$BOOST_JAM_TOOLSET

View File

@@ -273,6 +273,7 @@ load_builtins()
/* Initialize builtin modules */
init_set();
init_path();
}
/*

29
jam_src/modules/path.c Normal file
View File

@@ -0,0 +1,29 @@
#include "../native.h"
#include "../timestamp.h"
#include "../newstr.h"
LIST *path_exists( PARSE *parse, FRAME *frame )
{
LIST* l = lol_get( frame->args, 0 );
time_t time;
timestamp(l->string, &time);
if (time != 0)
{
return list_new(0, newstr("true"));
}
else
{
return L0;
}
}
void init_path()
{
{
char* args[] = { "location", 0 };
declare_native_rule("path", "exists", args, path_exists);
}
}

View File

@@ -202,6 +202,7 @@ rule exists ( file )
{
return [ path.glob $(file:D) : $(file:D=) ] ;
}
NATIVE_RULE path : exists ;