2 # Copyright © 2012 Jamie Zawinski <jwz@jwz.org>
4 # Permission to use, copy, modify, distribute, and sell this software and its
5 # documentation for any purpose is hereby granted without fee, provided that
6 # the above copyright notice appear in all copies and that both that
7 # copyright notice and this permission notice appear in supporting
8 # documentation. No representations are made about the suitability of this
9 # software for any purpose. It is provided "as is" without express or
12 # Created: 20-Jun-2012.
15 #use diagnostics; # Fails on some MacOS 10.5 - 10.7 systems
18 my $progname = $0; $progname =~ s@.*/@@g;
19 my $version = q{ $Revision: 1.2 $ }; $version =~ s/^[^\d]+([\d.]+).*/$1/;
26 my $d1 = $ENV{SDK_DIR} || '';
27 my $d2 = '/usr/include/netinet/';
28 foreach my $f ('ip.h', 'in_systm.h', 'ip_icmp.h', 'ip_var.h', 'udp.h') {
29 $fail .= "\tsudo ln -s $d2$f $d1$d2\n"
30 unless (-f "$d1$d2$f");
33 exit (0) unless $fail;
35 print STDERR "ERROR:\t" . join(' ', # "\n\t",
36 'The "Sonar" module won\'t build properly unless you repair your',
37 'SDK first. With some versions of Xcode, the ICMP header files',
38 'are present in the iPhone Simulator SDK but are missing from',
39 'the "real device" SDK. You can fix it by doing this:') .
45 print STDERR "usage: $progname\n";