2014-12-19 18:55:54 +08:00
|
|
|
#!/usr/local/bin/perl
|
|
|
|
|
|
|
|
my ($cflags, $platform) = @ARGV;
|
|
|
|
|
|
|
|
$cflags = "compiler: $cflags";
|
|
|
|
$date = localtime();
|
|
|
|
print <<"END_OUTPUT";
|
2016-02-11 02:11:40 +08: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 18:55:54 +08:00
|
|
|
END_OUTPUT
|
|
|
|
my $ctr = 0;
|
|
|
|
foreach my $c (split //, $cflags) {
|
2016-02-11 02:06:54 +08:00
|
|
|
$c =~ s|([\\'])|\\$1|;
|
2014-12-19 18:55:54 +08:00
|
|
|
# Max 18 characters per line
|
2016-02-11 02:06:54 +08:00
|
|
|
if (($ctr++ % 16) == 0) {
|
2015-01-06 23:32:01 +08:00
|
|
|
if ($ctr != 1) {
|
2014-12-19 18:55:54 +08:00
|
|
|
print "\n";
|
|
|
|
}
|
2016-02-11 02:11:40 +08:00
|
|
|
print " ";
|
2014-12-19 18:55:54 +08:00
|
|
|
}
|
|
|
|
print "'$c',";
|
|
|
|
}
|
|
|
|
print <<"END_OUTPUT";
|
|
|
|
'\\0'
|
2016-02-11 02:11:40 +08:00
|
|
|
};
|
|
|
|
#define PLATFORM "platform: $platform"
|
|
|
|
#define DATE "built on: $date"
|
2014-12-19 18:55:54 +08:00
|
|
|
END_OUTPUT
|