mkbuildinf.pl 829 B

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