]> git.saurik.com Git - apple/dyld.git/blame - bin/set-alt-dyld
dyld-519.2.1.tar.gz
[apple/dyld.git] / bin / set-alt-dyld
CommitLineData
412ebb8e
A
1#!/usr/bin/perl -w
2
3use strict;
4undef $/;
5
6if(@ARGV == 0)
7{
8 print "Usage: $0 <macho-executable> [<macho-executable> ...]\n";
9 exit 1;
10}
11
12my $arg;
13foreach $arg (@ARGV)
14{
15 open IN, "<$arg" or die $!;
16 my $in = <IN>;
17 close IN or die $!;
18
9f83892a 19 if($in =~ s{/usr/lib/dyld}{/usr/local/dy})
412ebb8e
A
20 {
21 open OUT, ">$arg" or die $!;
22 print OUT $in;
23 close OUT or die $!;
24 }
25 else
26 {
27 print STDERR "ERROR: $arg\n";
28 exit 1;
29 }
30}