]> git.ipfire.org Git - thirdparty/openssl.git/blame - util/perl/with_fallback.pm
Following the license change, modify the boilerplates in util/, tools/
[thirdparty/openssl.git] / util / perl / with_fallback.pm
CommitLineData
1212818e 1# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
ac3d0e13 2#
9059ab42 3# Licensed under the Apache License 2.0 (the "License"). You may not use
ac3d0e13
RS
4# this file except in compliance with the License. You can obtain a copy
5# in the file LICENSE in the source distribution or at
6# https://www.openssl.org/source/license.html
35c3a562
RL
7
8package with_fallback;
9
10sub import {
e9bc5706
RL
11 shift;
12
35c3a562
RL
13 use File::Basename;
14 use File::Spec::Functions;
15 foreach (@_) {
e9bc5706 16 eval "use $_";
35c3a562 17 if ($@) {
cb6afcd6
RL
18 unshift @INC, catdir(dirname(__FILE__),
19 "..", "..", "external", "perl");
35c3a562 20 my $transfer = "transfer::$_";
e9bc5706 21 eval "use $transfer";
35c3a562
RL
22 shift @INC;
23 warn $@ if $@;
24 }
25 }
26}
271;