]>
git.saurik.com Git - apple/dyld.git/blob - bin/expand.pl
6 my $sdk = $ENV{"SDKROOT"};
7 my $availCmd = $sdk . "/usr/local/libexec/availability.pl";
11 my $macroPrefix = shift;
14 my $cmd = $availCmd . " " . $availArg;
15 my $versionList = `$cmd`;
16 my $tmp = $versionList;
17 while ($tmp =~ m/^\s*([\S]+)(.*)$/) {
26 if ($vers =~ m/^(\d+)$/) {
28 $uvers = sprintf("%d_0", $major);
29 } elsif ($vers =~ m/^(\d+).(\d+)$/) {
32 $uvers = sprintf("%d_%d", $major, $minor);
33 } elsif ($vers =~ m/^(\d+).(\d+).(\d+)$/) {
38 $uvers = sprintf("%d_%d", $major, $minor);
41 $uvers = sprintf("%d_%d_%d", $major, $minor, $revision);
44 printf "#define %s%-18s 0x00%02X%02X%02X\n", $macroPrefix, $uvers, $major, $minor, $revision;
53 if(m/^\/\/\@MAC_VERSION_DEFS\@$/) {
54 expandVersions("DYLD_MACOSX_VERSION_", "--macosx");
56 elsif(m/^\/\/\@IOS_VERSION_DEFS\@$/) {
57 expandVersions("DYLD_IOS_VERSION_", "--ios");
59 elsif(m/^\/\/\@WATCHOS_VERSION_DEFS\@$/) {
60 expandVersions("DYLD_WATCHOS_VERSION_", "--watchos");