]> git.ipfire.org Git - thirdparty/openssl.git/blame - util/mkbuildinf.pl
use consistent error messages
[thirdparty/openssl.git] / util / mkbuildinf.pl
CommitLineData
488f16e3
MC
1#!/usr/local/bin/perl
2
3my ($cflags, $platform) = @ARGV;
4
5$cflags = "compiler: $cflags";
6$date = localtime();
7print <<"END_OUTPUT";
f4a748a1
RL
8/* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */
9#define CFLAGS cflags
10/*
11 * Generate CFLAGS as an array of individual characters. This is a
12 * workaround for the situation where CFLAGS gets too long for a C90 string
13 * literal
14 */
15static const char cflags[] = {
488f16e3
MC
16END_OUTPUT
17my $ctr = 0;
18foreach my $c (split //, $cflags) {
9ca2529d 19 $c =~ s|([\\'])|\\$1|;
488f16e3 20 # Max 18 characters per line
9ca2529d 21 if (($ctr++ % 16) == 0) {
b691154e 22 if ($ctr != 1) {
488f16e3
MC
23 print "\n";
24 }
f4a748a1 25 print " ";
488f16e3
MC
26 }
27 print "'$c',";
28}
29print <<"END_OUTPUT";
30'\\0'
f4a748a1
RL
31};
32#define PLATFORM "platform: $platform"
33#define DATE "built on: $date"
488f16e3 34END_OUTPUT