2016-04-20 02:10:43 +00:00
|
|
|
#! /usr/bin/env perl
|
2017-11-27 19:28:15 +00:00
|
|
|
# Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
|
2016-04-20 02:10:43 +00:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
2017-11-27 19:28:15 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
2014-12-19 10:55:54 +00:00
|
|
|
|
|
|
|
my ($cflags, $platform) = @ARGV;
|
|
|
|
$cflags = "compiler: $cflags";
|
2017-11-27 19:28:15 +00:00
|
|
|
|
|
|
|
my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} || time()) . " UTC";
|
|
|
|
|
2014-12-19 10:55:54 +00:00
|
|
|
print <<"END_OUTPUT";
|
2016-02-10 18:11:40 +00:00
|
|
|
/*
|
2017-11-27 19:28:15 +00:00
|
|
|
* WARNING: do not edit!
|
|
|
|
* Generated by util/mkbuildinf.pl
|
|
|
|
*
|
|
|
|
* Copyright 2014-2017 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define PLATFORM "platform: $platform"
|
|
|
|
#define DATE "built on: $date"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Generate compiler_flags as an array of individual characters. This is a
|
2016-02-10 18:11:40 +00:00
|
|
|
* workaround for the situation where CFLAGS gets too long for a C90 string
|
|
|
|
* literal
|
|
|
|
*/
|
2017-11-27 19:28:15 +00:00
|
|
|
static const char compiler_flags[] = {
|
2014-12-19 10:55:54 +00:00
|
|
|
END_OUTPUT
|
2017-11-27 19:28:15 +00:00
|
|
|
|
2014-12-19 10:55:54 +00:00
|
|
|
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
|
|
|
};
|
2014-12-19 10:55:54 +00:00
|
|
|
END_OUTPUT
|