]>
Commit | Line | Data |
---|---|---|
e0a65194 | 1 | #! /usr/bin/env perl |
8a8d9e19 | 2 | # Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. |
e0a65194 | 3 | # |
9059ab42 | 4 | # Licensed under the Apache License 2.0 (the "License"). You may not use |
e0a65194 RS |
5 | # this file except in compliance with the License. You can obtain a copy |
6 | # in the file LICENSE in the source distribution or at | |
7 | # https://www.openssl.org/source/license.html | |
8 | ||
8a8d9e19 RS |
9 | use strict; |
10 | use warnings; | |
488f16e3 MC |
11 | |
12 | my ($cflags, $platform) = @ARGV; | |
488f16e3 | 13 | $cflags = "compiler: $cflags"; |
8a8d9e19 RS |
14 | |
15 | my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} || time()) . " UTC"; | |
16 | ||
488f16e3 | 17 | print <<"END_OUTPUT"; |
f4a748a1 | 18 | /* |
8a8d9e19 RS |
19 | * WARNING: do not edit! |
20 | * Generated by util/mkbuildinf.pl | |
21 | * | |
22 | * Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. | |
23 | * | |
9059ab42 | 24 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
8a8d9e19 RS |
25 | * this file except in compliance with the License. You can obtain a copy |
26 | * in the file LICENSE in the source distribution or at | |
27 | * https://www.openssl.org/source/license.html | |
28 | */ | |
29 | ||
30 | #define PLATFORM "platform: $platform" | |
31 | #define DATE "built on: $date" | |
32 | ||
33 | /* | |
34 | * Generate compiler_flags as an array of individual characters. This is a | |
f4a748a1 RL |
35 | * workaround for the situation where CFLAGS gets too long for a C90 string |
36 | * literal | |
37 | */ | |
8a8d9e19 | 38 | static const char compiler_flags[] = { |
488f16e3 | 39 | END_OUTPUT |
8a8d9e19 | 40 | |
488f16e3 MC |
41 | my $ctr = 0; |
42 | foreach my $c (split //, $cflags) { | |
9ca2529d | 43 | $c =~ s|([\\'])|\\$1|; |
124cbe18 | 44 | # Max 16 characters per line |
9ca2529d | 45 | if (($ctr++ % 16) == 0) { |
b691154e | 46 | if ($ctr != 1) { |
488f16e3 MC |
47 | print "\n"; |
48 | } | |
f4a748a1 | 49 | print " "; |
488f16e3 MC |
50 | } |
51 | print "'$c',"; | |
52 | } | |
53 | print <<"END_OUTPUT"; | |
54 | '\\0' | |
f4a748a1 | 55 | }; |
488f16e3 | 56 | END_OUTPUT |