* hash.c - simple in-memory hashing routines
* hdrmacro.c - handle header file parsing for filename macro definitions
* headers.c - handle #includes in source files
- * jambase.c - compilable copy of Jambase
* jamgram.y - jam grammar
* lists.c - maintain lists of strings
* make.c - bring a target up to date, once rules are in place
#include "rules.h"
#include "scan.h"
#include "search.h"
+#include "startup.h"
#include "jam_strings.h"
#include "timestamp.h"
#include "variable.h"
#include "execcmd.h"
#include "sysinfo.h"
+#include <errno.h>
+#include <string.h>
+
/* Macintosh is "special" */
#ifdef OS_MAC
# include <QuickDraw.h>
static const char * othersyms[] = { OSMAJOR, OSMINOR, OSPLAT, JAMVERSYM, 0 };
-/* Known for sure:
- * mac needs arg_enviro
- * OS2 needs extern environ
- */
-
-#ifdef OS_MAC
-# define use_environ arg_environ
-# ifdef MPW
- QDGlobals qd;
-# endif
-#endif
-
-
-#ifdef OS_VMS
-# define use_environ arg_environ
-#endif
-
-
/* on Win32-LCC */
#if defined( OS_NT ) && defined( __LCC__ )
# define use_environ _environ
err_printf("-a Build all targets, even if they are current.\n");
err_printf("-dx Set the debug level to x (0-13,console,mi).\n");
- err_printf("-fx Read x instead of Jambase.\n");
+ err_printf("-fx Read x instead of bootstrap.\n");
/* err_printf( "-g Build from newest sources first.\n" ); */
err_printf("-jx Run up to x shell commands concurrently.\n");
err_printf("-lx Limit actions to x number of seconds after which they are stopped.\n");
exit( EXITBAD );
}
-int main( int argc, char * * argv, char * * arg_environ )
+int main( int argc, char * * argv )
{
int n;
char * s;
struct bjam_option optv[ N_OPTS ];
- int status;
+ int status = 0;
int arg_c = argc;
char * * arg_v = argv;
char const * progname = argv[ 0 ];
{
if ( !( globs.out = fopen( s, "w" ) ) )
{
- err_printf( "Failed to write to '%s'\n", s );
+ err_printf( "[errno %d] failed to write output file '%s': %s",
+ errno, s, strerror(errno) );
exit( EXITBAD );
}
/* ++globs.noexec; */
/* Initialize built-in rules. */
load_builtins();
+ b2::startup::load_builtins();
/* Add the targets in the command line to the update list. */
for ( n = 1; n < arg_c; ++n )
object_free( filename );
}
- if ( !n )
- parse_file( constant_plus, frame );
+ if ( !n )
+ status = b2::startup::bootstrap(frame) ? 0 : 13;
}
/* FIXME: What shall we do if builtin_update_now,
* failed earlier?
*/
- status = yyanyerrors();
- if ( !status )
+ if ( status == 0 )
+ status = yyanyerrors();
+ if ( status == 0 )
{
/* Manually touch -t targets. */
for ( n = 0; ( s = getoptval( optv, 't', n ) ); ++n )