Old stuff/ecole_etude_fac_de_pau/licence_3/projet_commun_se/backup16/configure
(Deskargatu)
#!/usr/bin/perl -w
my $arg = join(" ",@ARGV);
my $debug = " ";
my $max_users = 100;
if ($arg !~ /\w/)
{
print"Assumin default settings:
-m $max_users
debug disabled
";
}
if ($arg =~ /(?:\s|^)\-(?:h|(?:\-help))/)
{
print "Usage: $0 options
-m num (etablie le numero maximum d utilisateurs connectes
--max_users=num
-d (debug mode)
--debug
";
exit(1);
}
if ($arg =~ /(?:\s|^)\-(?:(?:m )|(?:\-max_users=))(\d+)/)
{
$max_users = $1;
print "Max users: $1\n";
}
if ($arg =~ /(?:\s|^)\-(?:d|(?:\-debug))/)
{
$debug = "-D DEBUG -D DEBUG_BAR_GERER_COM -D DEBUG_BAR_SECU -D DEBUG_BAR_ORDO ";
print "debug mode on\n";
}
$flags = $debug." -D MAX_USERS=".$max_users;
open(INFO,"Makefile.in") or die ("Makefile.in not found? ".$!);
print "Creating Makefile\n";
open(WRITE,">Makefile");
while(<INFO>)
{
if (/^flag=(.*)/)
{
$_ = "flag=$flags $1";
}
print WRITE $_;
}
close WRITE;
print "Creation du fichier Makefile avec succes:
./compil.sh pour compiler les programmes ...
";