X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/443210f774474a3c90d8adeda01417dd0dc1fbf7..4b52501b4cd5c33e7180075998e85b6478450cb5:/src/mk_supernovae.pl?ds=sidebyside diff --git a/src/mk_supernovae.pl b/src/mk_supernovae.pl deleted file mode 100644 index e0ea6dcbf2..0000000000 --- a/src/mk_supernovae.pl +++ /dev/null @@ -1,116 +0,0 @@ -#! /usr/bin/perl - -# Copyright (c) 2010-2011, 2014. The SimGrid Team. -# All rights reserved. - -# This program is free software; you can redistribute it and/or modify it -# under the terms of the license (GNU LGPL) which comes with this package. - -use strict; -use Getopt::Long qw(GetOptions); - -#open TMP,">mk_supernovae.pl.args"; -#map {print TMP "$_ "} @ARGV; -#close TMP; - -sub usage($) { - my $ret; - print "USAGE: mk_supernovae.pl [--fragile=file]* --out=file file1 file2*\n"; - print " --help: show this message\n"; - print " --fragile=file: specify that file is fragile and shouldn't be supernovaed\n"; - print " --out=file: specify the name of the output file\n"; - print "elements may be separated by semi-columns (;) instead of spaces, too\n"; - exit $ret; -} - -my @fragile_files=undef; -my $outfile=undef; -my $help; - -Getopt::Long::config('permute','no_getopt_compat', 'no_auto_abbrev'); -GetOptions( - 'help|h' => \$help, - - 'fragile=s' =>\@fragile_files, - 'out=s' =>\$outfile) or usage(1); - -@fragile_files = split(/;/,join(';',@fragile_files)); -@fragile_files = split(/ /,join(' ',@fragile_files)); - -usage(0) if (defined($help)); -unless(defined($outfile)) { - print "ERROR: No outfile defined.\n"; - usage(1); -} - -#print "mk_supernovae: generate $outfile\n"; - -open OUT, ">$outfile" or die "ERROR: cannot open $outfile: $!\n"; - -print OUT < -#include "portable.h" -#include "xbt.h" - -EOF - ; - -sub readfile($) { - my $filename=shift; - open IN,"$filename" || die "ERROR: cannot read $filename: $!\n"; - my $res; - while () { - $res .= $_; - } - close IN; - return $res; -} - - -my %fragile; -map {$fragile{$_}=1} @fragile_files; -my @args = split(/;/,join(';',@ARGV)); -@args = split(/ /,join(' ',@args)); -my $nbfile=0; -foreach my $file (@args) { - if ($fragile{$file}) { - print "mk_supernovae: $file is fragile, skip it\n"; - next; - } -# print "mk_supernovae: process $file\n"; - $nbfile++; - - my $needundef=1; - print OUT "/* file $file */\n"; - if ($file eq "xbt/log.c") { - print OUT " #define _simgrid_log_category__default &_simgrid_log_category__log\n"; - } else { - my $ctn = readfile($file); - if ($ctn =~ m/XBT_LOG_[^ ]*?DEFAULT_[^ ]*?CATEGORY/s) { - my $default=$ctn; - $default =~ s/.*XBT_LOG_[^ ]*?DEFAULT_[^ ]*?CATEGORY[^(]*\(([^,)]*).*$/$1/s; - print OUT " #define _simgrid_log_category__default &_simgrid_log_category__$default\n"; - } else { - print OUT " /* no default category in file $file */\n"; - $needundef = 0; - } - } - print OUT " #include \"$file\"\n"; - print OUT " #undef _simgrid_log_category__default\n" if $needundef; - print OUT "\n"; -} -close OUT; -print "mk_supernovae: $outfile contains $nbfile files inlined\n";