2016-04-20 10:10:43 +08:00
|
|
|
#! /usr/bin/env perl
|
|
|
|
# Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
# this file except in compliance with the License. You can obtain a copy
|
|
|
|
# in the file LICENSE in the source distribution or at
|
|
|
|
# https://www.openssl.org/source/license.html
|
|
|
|
|
2014-12-19 18:55:54 +08:00
|
|
|
|
|
|
|
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|;
|
2016-02-11 06:31:43 +08:00
|
|
|
# Max 16 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
|