Rich Salz | e0a6519 | 2016-04-19 22:10:43 -0400 | [diff] [blame] | 1 | #! /usr/bin/env perl |
| 2 | # Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the OpenSSL license (the "License"). You may not use |
| 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 | |
Matt Caswell | 488f16e | 2014-12-19 10:55:54 +0000 | [diff] [blame] | 9 | |
| 10 | my ($cflags, $platform) = @ARGV; |
| 11 | |
| 12 | $cflags = "compiler: $cflags"; |
| 13 | $date = localtime(); |
| 14 | print <<"END_OUTPUT"; |
Richard Levitte | f4a748a | 2016-02-10 19:11:40 +0100 | [diff] [blame] | 15 | /* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */ |
| 16 | #define CFLAGS cflags |
| 17 | /* |
| 18 | * Generate CFLAGS as an array of individual characters. This is a |
| 19 | * workaround for the situation where CFLAGS gets too long for a C90 string |
| 20 | * literal |
| 21 | */ |
| 22 | static const char cflags[] = { |
Matt Caswell | 488f16e | 2014-12-19 10:55:54 +0000 | [diff] [blame] | 23 | END_OUTPUT |
| 24 | my $ctr = 0; |
| 25 | foreach my $c (split //, $cflags) { |
Richard Levitte | 9ca2529 | 2016-02-10 19:06:54 +0100 | [diff] [blame] | 26 | $c =~ s|([\\'])|\\$1|; |
Richard Levitte | 124cbe1 | 2016-02-10 23:31:43 +0100 | [diff] [blame] | 27 | # Max 16 characters per line |
Richard Levitte | 9ca2529 | 2016-02-10 19:06:54 +0100 | [diff] [blame] | 28 | if (($ctr++ % 16) == 0) { |
Matt Caswell | b691154 | 2015-01-06 15:32:01 +0000 | [diff] [blame] | 29 | if ($ctr != 1) { |
Matt Caswell | 488f16e | 2014-12-19 10:55:54 +0000 | [diff] [blame] | 30 | print "\n"; |
| 31 | } |
Richard Levitte | f4a748a | 2016-02-10 19:11:40 +0100 | [diff] [blame] | 32 | print " "; |
Matt Caswell | 488f16e | 2014-12-19 10:55:54 +0000 | [diff] [blame] | 33 | } |
| 34 | print "'$c',"; |
| 35 | } |
| 36 | print <<"END_OUTPUT"; |
| 37 | '\\0' |
Richard Levitte | f4a748a | 2016-02-10 19:11:40 +0100 | [diff] [blame] | 38 | }; |
| 39 | #define PLATFORM "platform: $platform" |
| 40 | #define DATE "built on: $date" |
Matt Caswell | 488f16e | 2014-12-19 10:55:54 +0000 | [diff] [blame] | 41 | END_OUTPUT |