chacha/asm/chacha-ppc.pl: fix typo.
[openssl.git] / util / mkbuildinf.pl
1 #!/usr/local/bin/perl
2
3 my ($cflags, $platform) = @ARGV;
4
5 $cflags = "compiler: $cflags";
6 $date = localtime();
7 print <<"END_OUTPUT";
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  */
15 static const char cflags[] = {
16 END_OUTPUT
17 my $ctr = 0;
18 foreach my $c (split //, $cflags) {
19     $c =~ s|([\\'])|\\$1|;
20     # Max 16 characters per line
21     if  (($ctr++ % 16) == 0) {
22         if ($ctr != 1) {
23             print "\n";
24         }
25         print "    ";
26     }
27     print "'$c',";
28 }
29 print <<"END_OUTPUT";
30 '\\0'
31 };
32 #define PLATFORM "platform: $platform"
33 #define DATE "built on: $date"
34 END_OUTPUT