]>
Commit | Line | Data |
---|---|---|
488f16e3 MC |
1 | #!/usr/local/bin/perl |
2 | ||
3 | my ($cflags, $platform) = @ARGV; | |
4 | ||
5 | $cflags = "compiler: $cflags"; | |
6 | $date = localtime(); | |
7 | print <<"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 | */ | |
15 | static const char cflags[] = { | |
488f16e3 MC |
16 | END_OUTPUT |
17 | my $ctr = 0; | |
18 | foreach 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 | } | |
29 | print <<"END_OUTPUT"; | |
30 | '\\0' | |
f4a748a1 RL |
31 | }; |
32 | #define PLATFORM "platform: $platform" | |
33 | #define DATE "built on: $date" | |
488f16e3 | 34 | END_OUTPUT |