1#!/usr/local/bin/perl
| 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
|
2
| 8
|
| 9
|
3my ($cflags, $platform) = @ARGV; 4 5$cflags = "compiler: $cflags"; 6$date = localtime(); 7print <<"END_OUTPUT";
| 10my ($cflags, $platform) = @ARGV; 11 12$cflags = "compiler: $cflags"; 13$date = localtime(); 14print <<"END_OUTPUT";
|
8#ifndef MK1MF_BUILD 9 /* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */ 10 #define CFLAGS cflags 11 /* 12 * Generate CFLAGS as an array of individual characters. This is a 13 * workaround for the situation where CFLAGS gets too long for a C90 string 14 * literal 15 */ 16 static const char cflags[] = {
| 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 */ 22static const char cflags[] = {
|
17END_OUTPUT 18my $ctr = 0; 19foreach my $c (split //, $cflags) {
| 23END_OUTPUT 24my $ctr = 0; 25foreach my $c (split //, $cflags) {
|
20 # Max 18 characters per line 21 if (($ctr++ % 18) == 0) {
| 26 $c =~ s|([\\'])|\\$1|; 27 # Max 16 characters per line 28 if (($ctr++ % 16) == 0) {
|
22 if ($ctr != 1) { 23 print "\n"; 24 }
| 29 if ($ctr != 1) { 30 print "\n"; 31 }
|
25 print " ";
| 32 print " ";
|
26 } 27 print "'$c',"; 28} 29print <<"END_OUTPUT"; 30'\\0'
| 33 } 34 print "'$c',"; 35} 36print <<"END_OUTPUT"; 37'\\0'
|
31 }; 32 #define PLATFORM "platform: $platform" 33 #define DATE "built on: $date" 34#endif
| 38}; 39#define PLATFORM "platform: $platform" 40#define DATE "built on: $date"
|
35END_OUTPUT
| 41END_OUTPUT
|