gecko-dev/webtools/build/config.cgi

125 lines
3.2 KiB
Plaintext
Raw Normal View History

1999-02-18 21:52:11 +00:00
#!/usr/bonsaitools/bin/perl --
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bonsai CVS tool.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
1999-02-18 21:27:26 +00:00
use CGI;
$query = new CGI;
1999-02-18 21:52:11 +00:00
$field_separator = "<<fs>>";
1999-02-19 20:17:25 +00:00
$configure_in = "configure.in";
$chrome_color = "#F0A000";
1999-02-18 21:27:26 +00:00
if ($query->param()) {
1999-02-19 20:17:25 +00:00
print "Content-type: text/html\n\n\n";
print "<pre>";
1999-02-18 21:27:26 +00:00
foreach $param ($query->param()) {
1999-02-19 20:17:25 +00:00
if ($param =~ /^MOZ_/) {
} elsif ($param =~ /^--/) {
next if $query->param($param) eq "";
print "ac_add_options $param";
print "=".$query->param($param) if $query->param($param) ne "yes";
print "\n";
}
1999-02-18 21:27:26 +00:00
}
1999-02-19 20:17:25 +00:00
print "</pre>";
1999-02-18 21:27:26 +00:00
} else {
1999-02-19 20:17:25 +00:00
print "Content-type: text/html\n\n\n";
1999-02-18 21:27:26 +00:00
print qq(
1999-02-19 20:17:25 +00:00
<HTML>
<HEAD>
<TITLE>Configure Unix Mozilla build</TITLE>
</HEAD>
<body BGCOLOR="#FFFFFF" TEXT="#000000"LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
);
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>
);
1999-02-18 21:27:26 +00:00
#open(OPTIONS, "m4 webify-configure.m4 $configure_in|")
open(OPTIONS, "<parsed-configure.txt")
or die "Error parsing configure.in\n";
1999-02-18 21:27:26 +00:00
foreach (<OPTIONS>) {
chomp;
1999-02-19 20:17:25 +00:00
($type, $prename, $name, $comment) = split /$field_separator/;
($dummy,$dummy2,$help) = split /\s+/, $comment, 3;
#$help =~ s/\\\$/\$/g;
if ($type eq "header") {
&header_option($comment);
} else {
eval "&${type}_option(\"--$prename-$name\",\"$help\");";
1999-02-18 21:27:26 +00:00
}
}
print qq(
</table>
1999-02-19 20:17:25 +00:00
</td></tr></table>
</td></tr></table>
1999-02-18 21:27:26 +00:00
<input type="Submit">
</form>
);
1999-02-19 20:17:25 +00:00
print "\n</body>\n</html>\n";
1999-02-18 21:27:26 +00:00
}
sub bool_option {
my ($name, $help) = @_;
1999-02-19 20:17:25 +00:00
print qq(<tr><td align=right>
<INPUT type='checkbox' name='$name' value="yes">
</td><td>$name
</td><td>$help</td></tr>
);
1999-02-18 21:27:26 +00:00
}
sub string_option {
my ($name, $help) = @_;
print "<tr><td align=right>$name=</td><td align=left>";
print "<INPUT type='text' name='$name'>";
print "</td><td>$help</td></tr>\n";
}
1999-02-19 20:17:25 +00:00
sub bool_or_string_option {
my ($name, $help) = @_;
print "<tr><td align=right>";
print "<INPUT type='checkbox' name='$name'>";
print "</td><td>$name";
print "</td><td>$help</td></tr>\n";
print "<tr><td align=right>$name=</td><td align=left>";
print "<INPUT type='text' name='$name'>";
print "</td><td>$help</td></tr>\n";
}
sub header_option {
my ($header) = @_;
print qq(<tr bgcolor=$chrome_color><td colspan=3>
<b><font face="Arial,Helvetica">
$header
</font></b></td></tr>
);
}