2014-12-19 10:55:54 +00:00
|
|
|
#!/usr/local/bin/perl
|
|
|
|
|
|
|
|
my ($cflags, $platform) = @ARGV;
|
|
|
|
|
|
|
|
$cflags = "compiler: $cflags";
|
|
|
|
$date = localtime();
|
|
|
|
print <<"END_OUTPUT";
|
2016-02-10 18:11:40 +00:00
|
|
|
/* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */
|
|
|
|
#define CFLAGS cflags
|
|
|
|
/*
|
|
|
|
* Generate CFLAGS as an array of individual characters. This is a
|
|
|
|
* workaround for the situation where CFLAGS gets too long for a C90 string
|
|
|
|
* literal
|
|
|
|
*/
|
|
|
|
static const char cflags[] = {
|
2014-12-19 10:55:54 +00:00
|
|
|
END_OUTPUT
|
|
|
|
my $ctr = 0;
|
|
|
|
foreach my $c (split //, $cflags) {
|
2016-02-10 18:06:54 +00:00
|
|
|
$c =~ s|([\\'])|\\$1|;
|
2016-02-10 22:31:43 +00:00
|
|
|
# Max 16 characters per line
|
2016-02-10 18:06:54 +00:00
|
|
|
if (($ctr++ % 16) == 0) {
|
2015-01-06 15:32:01 +00:00
|
|
|
if ($ctr != 1) {
|
2014-12-19 10:55:54 +00:00
|
|
|
print "\n";
|
|
|
|
}
|
2016-02-10 18:11:40 +00:00
|
|
|
print " ";
|
2014-12-19 10:55:54 +00:00
|
|
|
}
|
|
|
|
print "'$c',";
|
|
|
|
}
|
|
|
|
print <<"END_OUTPUT";
|
|
|
|
'\\0'
|
2016-02-10 18:11:40 +00:00
|
|
|
};
|
|
|
|
#define PLATFORM "platform: $platform"
|
|
|
|
#define DATE "built on: $date"
|
2014-12-19 10:55:54 +00:00
|
|
|
END_OUTPUT
|