Skip to content
Snippets Groups Projects
Commit 90737199 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

dump 50 modules at a time

Rev: bin/install.pike:1.48
Rev: src/dumpmaster.pike:1.3
Rev: src/dumpmodule.pike:1.8
parent 6375f2e9
No related merge requests found
...@@ -297,6 +297,16 @@ void install_header_files(string from, string to) ...@@ -297,6 +297,16 @@ void install_header_files(string from, string to)
mapping vars=([]); mapping vars=([]);
string fakeroot(string s)
{
if(vars->fakeroot)
{
return vars->fakeroot+combine_path(getcwd(),s);
}else{
return s;
}
}
string export_base_name; string export_base_name;
int mklink(string from, string to) int mklink(string from, string to)
...@@ -1064,22 +1074,22 @@ void do_install() ...@@ -1064,22 +1074,22 @@ void do_install()
lib_prefix); lib_prefix);
} }
install_dir(vars->TMP_LIBDIR,lib_prefix,1); install_dir(fakeroot(vars->TMP_LIBDIR),lib_prefix,1);
install_dir(vars->LIBDIR_SRC,lib_prefix,1); install_dir(fakeroot(vars->LIBDIR_SRC),lib_prefix,1);
install_header_files(vars->SRCDIR,include_prefix); install_header_files(fakeroot(vars->SRCDIR),include_prefix);
install_header_files(vars->TMP_BUILDDIR,include_prefix); install_header_files(fakeroot(vars->TMP_BUILDDIR),include_prefix);
install_file(combine_path(vars->TMP_BUILDDIR,"modules/dynamic_module_makefile"), install_file(fakeroot(combine_path(vars->TMP_BUILDDIR,"modules/dynamic_module_makefile")),
combine_path(include_prefix,"dynamic_module_makefile")); combine_path(include_prefix,"dynamic_module_makefile"));
install_file(combine_path(vars->TMP_BUILDDIR,"aclocal"), install_file(fakeroot(combine_path(vars->TMP_BUILDDIR,"aclocal")),
combine_path(include_prefix,"aclocal.m4")); combine_path(include_prefix,"aclocal.m4"));
if(file_stat(vars->MANDIR_SRC)) if(file_stat(vars->MANDIR_SRC))
{ {
// trace(9); // trace(9);
// _debug(5); // _debug(5);
install_dir(vars->MANDIR_SRC,combine_path(man_prefix,"man1"),0); install_dir(fakeroot(vars->MANDIR_SRC),combine_path(man_prefix,"man1"),0);
} }
}; };
...@@ -1098,21 +1108,31 @@ void do_install() ...@@ -1098,21 +1108,31 @@ void do_install()
mixed s2=file_stat(master+".o"); mixed s2=file_stat(master+".o");
if(!s1 || !s2 || s1[3]>=s2[3] || redump_all) if(!s1 || !s2 || s1[3]>=s2[3] || redump_all)
{ {
Process.create_process( ({pike,"-m",combine_path(vars->SRCDIR,"dumpmaster.pike"),master}))->wait(); Process.create_process( ({pike,"-m",
combine_path(vars->SRCDIR,"dumpmaster.pike"),
@(vars->fakeroot? ({"--fakeroot="+vars->fakeroot}):({})),
master}))->wait();
} }
if(sizeof(to_dump)) if(sizeof(to_dump))
{ {
status("Dumping modules, please wait..."); status("Dumping modules, please wait...");
foreach(to_dump, string mod) rm(mod+".o"); foreach(to_dump, string mod) rm(mod+".o");
/* Dump 50 modules at a time */
write("\n");
foreach(to_dump/50,to_dump)
{
write(" ");
Process.create_process( ({pike, Process.create_process( ({pike,
combine_path(vars->SRCDIR,"dumpmodule.pike"), combine_path(vars->SRCDIR,"dumpmodule.pike"),
#if defined(USE_GTK) && constant(GTK.parse_rc) #if defined(USE_GTK) && constant(GTK.parse_rc)
label1?"--distquiet": label1?"--distquiet":
#endif #endif
"--quiet" "--quiet",
@(vars->fakeroot? ({"--fakeroot="+vars->fakeroot}):({})),
}) + to_dump)->wait(); }) + to_dump)->wait();
} }
}
// Delete any .pmod files that would shadow the .so // Delete any .pmod files that would shadow the .so
// files that we just installed. For a new installation // files that we just installed. For a new installation
......
#define UNDEFINED (([])[0]) #define UNDEFINED (([])[0])
string fakeroot;
void handle_error(mixed err) void handle_error(mixed err)
{ {
werror("%O\n",err); werror("%O\n",err);
} }
string read_file(string s)
{
if(fakeroot)
s=fakeroot+combine_path(getcwd(),s);
return _static_modules.files()->Fd(s,"r")->read();
}
program compile_file(string file) program compile_file(string file)
{ {
return compile(cpp(_static_modules.files()->Fd(file,"r")->read(),file)); return compile(cpp(read_file(file),file));
} }
class Codec class Codec
...@@ -19,6 +30,9 @@ class Codec ...@@ -19,6 +30,9 @@ class Codec
} }
void _main(string *argv, string *env) void _main(string *argv, string *env)
{ {
foreach(argv[1..sizeof(argv)-2], string f)
sscanf(f,"--fakeroot=%s",fakeroot);
program p=compile_file(argv[-1]); program p=compile_file(argv[-1]);
string s=encode_value(p, Codec()); string s=encode_value(p, Codec());
_static_modules.files()->Fd(argv[-1] + ".o","wct")->write(s); _static_modules.files()->Fd(argv[-1] + ".o","wct")->write(s);
......
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
program p; program p;
string fakeroot;
class FakeMaster
{
inherit "/master";
string master_read_file(string s)
{
return ::master_read_file(fakeroot+combine_path_with_cwd(s));
}
}
#define error(X) throw( ({ (X), backtrace()[0..sizeof(backtrace())-2] }) ) #define error(X) throw( ({ (X), backtrace()[0..sizeof(backtrace())-2] }) )
class Codec class Codec
{ {
...@@ -100,30 +111,7 @@ void log(string file, int line, string err) ...@@ -100,30 +111,7 @@ void log(string file, int line, string err)
logfile->write(sprintf("%s:%d:%s\n",file,line,err)); logfile->write(sprintf("%s:%d:%s\n",file,line,err));
} }
int main(int argc, string *argv) void dumpit(string file)
{
if(argv[1]=="--quiet")
{
quiet=1;
argv=argv[1..];
master()->set_inhibit_compile_errors(log);
// FIXME: Make this a command line option..
// It should not be done when running a binary dist
// installation...
logfile=Stdio.File("dumpmodule.log","cwt");
// werror("Dumping modules ");
}
if(argv[1]=="--distquiet")
{
quiet=2;
argv=argv[1..];
master()->set_inhibit_compile_errors(log);
logfile=0;
}
foreach(argv[1..],string file)
{ {
if(!quiet) if(!quiet)
werror(file +": "); werror(file +": ");
...@@ -191,6 +179,39 @@ int main(int argc, string *argv) ...@@ -191,6 +179,39 @@ int main(int argc, string *argv)
#endif #endif
} }
} }
int main(int argc, string *argv)
{
if(argv[1]=="--quiet")
{
quiet=1;
argv=argv[1..];
master()->set_inhibit_compile_errors(log);
// FIXME: Make this a command line option..
// It should not be done when running a binary dist
// installation...
logfile=Stdio.File("dumpmodule.log","cwt");
// werror("Dumping modules ");
}
if(argv[1]=="--distquiet")
{
quiet=2;
argv=argv[1..];
master()->set_inhibit_compile_errors(log);
logfile=0;
}
if(sscanf(argv[1],"--fakeroot=%s",fakeroot))
{
argv=argv[1..];
replace_master(FakeMaster());
}
foreach(argv[1..],string file)
dumpit(file);
if(quiet==1) if(quiet==1)
werror("\n"); werror("\n");
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment