2016-04-20 10:10:43 +08:00
|
|
|
#! /usr/bin/env perl
|
2017-11-28 03:28:15 +08:00
|
|
|
# Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
|
2016-04-20 10:10:43 +08:00
|
|
|
#
|
2018-12-06 20:03:50 +08:00
|
|
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-04-20 10:10:43 +08:00
|
|
|
# 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-28 03:28:15 +08:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
2014-12-19 18:55:54 +08:00
|
|
|
|
|
|
|
my ($cflags, $platform) = @ARGV;
|
|
|
|
$cflags = "compiler: $cflags";
|
2017-11-28 03:28:15 +08:00
|
|
|
|
2024-10-15 20:25:34 +08:00
|
|
|
# Use the value of the envvar SOURCE_DATE_EPOCH, even if it's
|
|
|
|
# zero or the empty string.
|
|
|
|
my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} // time()) . " UTC";
|
2017-11-28 03:28:15 +08:00
|
|
|
|
2014-12-19 18:55:54 +08:00
|
|
|
print <<"END_OUTPUT";
|
2016-02-11 02:11:40 +08:00
|
|
|
/*
|
2017-11-28 03:28:15 +08:00
|
|
|
* WARNING: do not edit!
|
|
|
|
* Generated by util/mkbuildinf.pl
|
|
|
|
*
|
|
|
|
* Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
*
|
2018-12-06 20:03:50 +08:00
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
2017-11-28 03:28:15 +08:00
|
|
|
* 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-11 02:11:40 +08:00
|
|
|
* workaround for the situation where CFLAGS gets too long for a C90 string
|
|
|
|
* literal
|
|
|
|
*/
|
2017-11-28 03:28:15 +08:00
|
|
|
static const char compiler_flags[] = {
|
2014-12-19 18:55:54 +08:00
|
|
|
END_OUTPUT
|
2017-11-28 03:28:15 +08:00
|
|
|
|
2014-12-19 18:55:54 +08:00
|
|
|
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
|
|
|
};
|
2014-12-19 18:55:54 +08:00
|
|
|
END_OUTPUT
|