|
38 | 38 |
|
39 | 39 | our $src_dir = "../openssl";
|
40 | 40 | our $arch_dir = "../config/archs/$arch";
|
| 41 | +our $arch_common_dir = "$arch_dir/common"; |
41 | 42 | our $base_dir = "$arch_dir/$asm";
|
42 | 43 |
|
43 | 44 | my $is_win = ($arch =~/^VC-WIN/);
|
|
59 | 60 | "$base_dir/apps",
|
60 | 61 | {
|
61 | 62 | error => \my $make_path_err});
|
| 63 | + |
| 64 | +if (not $is_win) { |
| 65 | +make_path("$arch_common_dir/include", "$arch_common_dir/include/openssl", |
| 66 | + "$arch_common_dir/include/crypto", |
| 67 | + { |
| 68 | + error => \my $make_path_err}); |
| 69 | +} |
| 70 | + |
62 | 71 | if (@$make_path_err) {
|
63 | 72 | for my $diag (@$make_path_err) {
|
64 | 73 | my ($file, $message) = %$diag;
|
|
367 | 376 | system($cmd2) == 0 or die "Error in system($cmd2)";
|
368 | 377 |
|
369 | 378 |
|
| 379 | + |
370 | 380 | sub copy_headers {
|
371 | 381 | my @headers = split / /, $_[0];
|
372 | 382 | my $inc_dir = $_[1];
|
| 383 | + my $header_path = ""; |
| 384 | + my $arch_header_include_template = Text::Template->new(TYPE => 'FILE', |
| 385 | + SOURCE => 'arch_include.h.tmpl', |
| 386 | + DELIMITERS => [ "%%-", "-%%" ] |
| 387 | + ); |
373 | 388 | foreach my $header_name (@headers) {
|
374 |
| - # Copy the header from OpenSSL source directory to the arch specific dir. |
375 |
| - #print("copy header $src_dir/include/$inc_dir/${header_name}.h to $base_dir/include/$inc_dir \n"); |
376 |
| - copy("$src_dir/include/$inc_dir/${header_name}.h", |
377 |
| - "$base_dir/include/$inc_dir/") or die "Copy failed: $!"; |
| 389 | + $header_path = "include/$inc_dir/${header_name}.h"; |
| 390 | + if ($is_win) { |
| 391 | + #print("copy header $src_dir/$header_path to $base_dir/$header_path \n"); |
| 392 | + copy("$src_dir/$header_path", |
| 393 | + "$base_dir/include/$inc_dir/") or die "Copy failed: $!"; |
| 394 | + } else { |
| 395 | + #print("copy header $src_dir/$header_path to $arch_common_dir/$header_path \n"); |
| 396 | + copy("$src_dir/$header_path", |
| 397 | + "$arch_common_dir/$header_path") or die "Copy failed: $!"; |
| 398 | + # Generate a header file with the same name in the arch dependant directory |
| 399 | + # which points to the common directory. This is done to avoid copying |
| 400 | + # duplicate headers. |
| 401 | + my $arch_header_include = $arch_header_include_template->fill_in( |
| 402 | + HASH => { |
| 403 | + path => "$header_path", |
| 404 | + }); |
| 405 | + open(ARCH_HEADER_INC, "> $base_dir/$header_path"); |
| 406 | + print ARCH_HEADER_INC "$arch_header_include"; |
| 407 | + close(ARCH_HEADER_INC); |
| 408 | + } |
378 | 409 | }
|
379 | 410 | }
|
0 commit comments