зеркало из https://github.com/mozilla/pjs.git
Almost ready for first release.
This commit is contained in:
Родитель
c2b6483df5
Коммит
216057ae1f
|
@ -26,44 +26,184 @@
|
|||
use CGI;
|
||||
|
||||
$query = new CGI;
|
||||
$field_separator = "<<fs>>";
|
||||
$configure_in = "configure.in";
|
||||
$chrome_color = "#F0A000";
|
||||
$field_separator = '<<fs>>';
|
||||
$configure_in = 'mozilla/configure.in';
|
||||
$chrome_color = '#F0A000';
|
||||
$ENV{CVSROOT} = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot';
|
||||
#$ENV{PATH} = "$ENV{PATH}:/usr/bin/ccs"; # for m4
|
||||
|
||||
print "Content-type: text/html\n\n\n";
|
||||
|
||||
if ($query->param()) {
|
||||
print "Content-type: text/html\n\n\n";
|
||||
print "<pre>";
|
||||
if ($query->param(preview) eq "yes") {
|
||||
&print_script_preview;
|
||||
} else {
|
||||
&print_script;
|
||||
}
|
||||
} else {
|
||||
&print_configure_form;
|
||||
}
|
||||
|
||||
sub print_script_preview {
|
||||
print qq(
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>myconfig.sh Preview</TITLE>
|
||||
</HEAD>
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000"LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
|
||||
<table bgcolor="#FF0000" cellspacing=0 cellpadding=0><tr><td>
|
||||
<table bgcolor="#FFFFFF" cellspacing=0 cellpadding=10 width="500"><tr><td>
|
||||
<pre>);
|
||||
|
||||
&print_script;
|
||||
|
||||
print qq(</pre>
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
);
|
||||
}
|
||||
|
||||
sub print_script {
|
||||
|
||||
print "# sh\n";
|
||||
print "# Build configuration script\n";
|
||||
print "#\n";
|
||||
print "# Save this script to $HOME/.mozmyconfig.sh,\n";
|
||||
print "# or one of the places listed below.\n";
|
||||
print "#\n";
|
||||
print "# The build searches for this script in the following places:\n";
|
||||
print "# If \$MOZ_MYCONFIG is set, use that file,\n";
|
||||
print "# else try <objdir>/myconfig.sh\n";
|
||||
print "# else try <topsrcdir>/myconfig.sh\n";
|
||||
print "# else try $HOME/.mozmyconfig.sh\n";
|
||||
print "#\n";
|
||||
print "\n";
|
||||
foreach $param ($query->param()) {
|
||||
|
||||
if ($param =~ /^MOZ_/) {
|
||||
if ($query->param($param) ne '') {
|
||||
print "mk_add_options $param=".$query->param($param)."\n";
|
||||
$need_blank_line = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
print "\n" if $need_blank_line;
|
||||
if ($query->param('nspr_option') eq 'userdefined') {
|
||||
print "ac_add_options --with-nspr=".$query->param('nspr_dir')."\n";
|
||||
}
|
||||
if ($query->param('nspr_option') eq 'rpm') {
|
||||
print "ac_add_options --with-nspr=/usr\n";
|
||||
}
|
||||
if ($query->param('debug_option') eq 'userdefined') {
|
||||
print "ac_add_options --enable-debug=".$query->param('debug_dirs')."\n";
|
||||
}
|
||||
if ($query->param('debug_option') eq 'yes') {
|
||||
print "ac_add_options --enable-debug\n";
|
||||
}
|
||||
|
||||
} elsif ($param =~ /^--/) {
|
||||
foreach $param ($query->param()) {
|
||||
if ($param =~ /^--/) {
|
||||
next if $query->param($param) eq "";
|
||||
print "ac_add_options $param";
|
||||
print "=".$query->param($param) if $query->param($param) ne "yes";
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
print "</pre>";
|
||||
} else {
|
||||
print "Content-type: text/html\n\n\n";
|
||||
print qq(
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Configure Unix Mozilla build</TITLE>
|
||||
</HEAD>
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000"LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
|
||||
);
|
||||
}
|
||||
|
||||
sub print_configure_form {
|
||||
system "cvs co mozilla/configure.in";
|
||||
|
||||
print qq(
|
||||
<FORM action='config.cgi' method='POST'>
|
||||
<table bgcolor="$chrome_color" cellspacing=0 cellpadding=0><tr><td>
|
||||
<table bgcolor="#FFFFFF" cellspacing=0 cellpadding=0><tr><td>
|
||||
<table cellspacing=0 cellpadding=1>
|
||||
);
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Mozilla Unix Build Configurator</TITLE>
|
||||
</HEAD>
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000"LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
|
||||
|
||||
#open(OPTIONS, "m4 webify-configure.m4 $configure_in|")
|
||||
open(OPTIONS, "<parsed-configure.txt")
|
||||
<font size='+1' face='Helvetica,Arial'><b>
|
||||
Mozilla Unix Build Configurator</b></font><p>
|
||||
|
||||
This form produces a script that you can save and use to configure your
|
||||
mozilla build.
|
||||
|
||||
<FORM action='config.cgi' method='POST'>
|
||||
<INPUT Type='hidden' name='preview' value='yes'>
|
||||
|
||||
<table bgcolor="$chrome_color" cellspacing=0 cellpadding=0><tr><td>
|
||||
<table bgcolor="#FFFFFF" cellspacing=0 cellpadding=0><tr><td>
|
||||
<table cellspacing=0 cellpadding=1>
|
||||
|
||||
<!-- Checkout options -->
|
||||
<tr bgcolor="$chrome_color"><td>
|
||||
<font face="Helvetica,Arial"><b>Checkout options:</b></font><br>
|
||||
</td></tr><tr><td>
|
||||
<table cellpadding=0 cellspacing=0><tr><td>
|
||||
Module to checkout
|
||||
</td><td>
|
||||
<input type="text" name="MOZ_CO_MODULES"> (default is SeaMonkeyEditor)
|
||||
</td></tr><tr><td>
|
||||
Branch to checkout
|
||||
</td><td>
|
||||
<input type="text" name="MOZ_CO_BRANCH"> (default is HEAD)
|
||||
</td></tr></table>
|
||||
</td></tr>
|
||||
|
||||
<!-- Object Directory -->
|
||||
<tr bgcolor="$chrome_color"><td>
|
||||
<font face="Helvetica,Arial"><b>
|
||||
Object Directory:</b></font><br>
|
||||
</td></tr><tr><td>
|
||||
<input type="radio" name="MOZ_OBJDIR" value="\@TOPSRCDIR\@" checked>
|
||||
mozilla (i.e. In the source tree)<br>
|
||||
<input type="radio" name="MOZ_OBJDIR" value="\@TOPSRCDIR\@/obj-\@CONFIG_GUESS\@">
|
||||
mozilla/obj-\@CONFIG_GUESS\@ (e.g. <code>mozilla/obj-i686-pc-linux-gnu</code>)<br>
|
||||
<!-- Take this option out for now...
|
||||
<input type="radio" name="MOZ_OBJDIR" value="\@TOPSRCDIR\@/../obj-\@CONFIG_GUESS\@">
|
||||
mozilla/../obj-\@CONFIG_GUESS\@ (e.g. <code>mozilla/../obj-i686-pc-linux-gnu</code>)<br>
|
||||
-->
|
||||
</td></tr>
|
||||
|
||||
<!-- NSPR -->
|
||||
<tr bgcolor="$chrome_color"><td>
|
||||
<font face="Helvetica,Arial"><b>NSPR to use:</b></font><br>
|
||||
</td></tr><tr><td>
|
||||
<input type="radio" name="nspr_option" value="tip" checked>
|
||||
Build nspr from the tip<br>
|
||||
<input type="radio" name="nspr_option" value="userdefined">
|
||||
NSPR is installed in
|
||||
<input type="text" name="nspr_dir"><br>
|
||||
<input type="radio" name="nspr_option" value="rpm">
|
||||
NSPR is installed in /usr/lib (NSPR RPM installation)
|
||||
</td></tr>
|
||||
|
||||
<!-- Debug -->
|
||||
<tr bgcolor="$chrome_color"><td>
|
||||
<font face="Helvetica,Arial"><b>Debug option:</b></font><br>
|
||||
</td></tr><tr><td>
|
||||
<input type="radio" name="debug_option" value="yes" checked>
|
||||
Enable debugging<br>
|
||||
<input type="radio" name="debug_option" value="no">
|
||||
Disable debugging<br>
|
||||
<input type="radio" name="debug_option" value="userdefined">
|
||||
Enable debugging but only for the following directories: <br>
|
||||
|
||||
<input type="text" name="debug_dirs" size=50> (comma separated, no spaces)<br>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
|
||||
<br>
|
||||
<font size=+1 face="Helvetica,Arial"><b>
|
||||
Options for `<code>configure</code>' script:</b></font><br>
|
||||
|
||||
<table bgcolor="$chrome_color" cellspacing=0 cellpadding=0><tr><td>
|
||||
<table bgcolor="#FFFFFF" cellspacing=0 cellpadding=0><tr><td>
|
||||
<table cellspacing=0 cellpadding=1>
|
||||
);
|
||||
|
||||
open(OPTIONS, "m4 webify-configure.m4 $configure_in|")
|
||||
or die "Error parsing configure.in\n";
|
||||
|
||||
foreach (<OPTIONS>) {
|
||||
|
@ -72,6 +212,8 @@ if ($query->param()) {
|
|||
($dummy,$dummy2,$help) = split /\s+/, $comment, 3;
|
||||
#$help =~ s/\\\$/\$/g;
|
||||
|
||||
next if $name eq 'debug';
|
||||
|
||||
if ($type eq "header") {
|
||||
&header_option($comment);
|
||||
} else {
|
||||
|
@ -83,13 +225,12 @@ if ($query->param()) {
|
|||
</table>
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
<input type="Submit">
|
||||
<input type="Submit" value="Preview Build Script">
|
||||
</form>
|
||||
);
|
||||
print "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
|
||||
sub bool_option {
|
||||
my ($name, $help) = @_;
|
||||
|
||||
|
|
|
@ -18,9 +18,11 @@ dnl
|
|||
divert(-1)dnl Throw away output until we want it
|
||||
changequote([, ])
|
||||
|
||||
dnl webify-configure.m4 - Read in configure.in and spit out
|
||||
dnl html appropriate to configure the options.
|
||||
|
||||
dnl webify-configure.m4 - Read in configure.in and print options to stdout.
|
||||
dnl
|
||||
dnl Usage:
|
||||
dnl m4 webify-configure.in configure.in
|
||||
dnl
|
||||
dnl Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче