Loading...
xcodescripts/generate_features.pl Libc-825.24 Libc-997.90.3
--- Libc/Libc-825.24/xcodescripts/generate_features.pl
+++ Libc/Libc-997.90.3/xcodescripts/generate_features.pl
@@ -51,7 +51,7 @@
 			my $regex = $2;
 			
 			$nested++;
-			if ($ENV{$envvar} !~ /$regex/) {
+			if (!defined($ENV{$envvar}) || ($ENV{$envvar} !~ /$regex/)) {
 				$skip += 1;
 			}
 		}
@@ -78,12 +78,16 @@
 	}
 
 	elsif ($unifdef == 1) {
+		if ($platformName eq "macosx") {
+			$unifdefs{"__OSX_OPEN_SOURCE__"} = 1;
+		}
 		# assume FEATURE_BLOCKS was on by default
 		$unifdefs{"UNIFDEF_BLOCKS"} = 1;
 		$unifdefs{"UNIFDEF_LEGACY_64_APIS"} = defined($features{"FEATURE_LEGACY_64_APIS"});
 		$unifdefs{"UNIFDEF_LEGACY_RUNE_APIS"} = defined($features{"FEATURE_LEGACY_RUNE_APIS"});
 		$unifdefs{"UNIFDEF_LEGACY_UTMP_APIS"} = defined($features{"FEATURE_LEGACY_UTMP_APIS"});
 		$unifdefs{"UNIFDEF_MOVE_LOCALTIME"} = defined($features{"FEATURE_MOVE_LOCALTIME"});
+		$unifdefs{"UNIFDEF_TZDIR_SYMLINK"} = defined($features{"FEATURE_TZDIR_SYMLINK"});
 		
 		my $output = "";
 		for my $d (keys %unifdefs) {
@@ -100,7 +104,7 @@
 		my $platform_mtime = (stat($platformPath))[9];
 		my $header_mtime = (stat($featuresHeader))[9];
 
-		if ($header_mtime > $platform_mtime) {
+		if (defined($header_mtime) && defined($platform_mtime) && ($header_mtime > $platform_mtime)) {
 			exit 0;
 		}
 
@@ -149,6 +153,12 @@
 			printf HEADER "#define UNIFDEF_MOVE_LOCALTIME 1\n";
 		} else {
 			printf HEADER "/* #undef UNIFDEF_MOVE_LOCALTIME */\n";
+		}
+
+		if (defined($features{"FEATURE_TZDIR_SYMLINK"})) {
+			printf HEADER "#define UNIFDEF_TZDIR_SYMLINK 1\n";
+		} else {
+			printf HEADER "/* #undef UNIFDEF_TZDIR_SYMLINK */\n";
 		}
 
 		if (defined($features{"FEATURE_ONLY_1050_VARIANTS"})) {
@@ -187,12 +197,6 @@
 			printf HEADER "/* #undef __APPLE_PR3417676_HACK__ */\n";
 		}
 
-		if (defined($features{"FEATURE_PATCH_5243343"})) {
-			printf HEADER "#define PR_5243343 1\n";
-		} else {
-			printf HEADER "/* #undef PR_5243343 */\n";
-		}
-
 		if (defined($features{"FEATURE_PLOCKSTAT"})) {
 			printf HEADER "#define PLOCKSTAT 1\n";
 		} else {
@@ -211,10 +215,16 @@
 			printf HEADER "/* #undef LIBC_NO_LIBCRASHREPORTERCLIENT */\n";
 		}
 
-		if (defined($features{"FEATURE_MEMORYSTATUS"})) {
-			printf HEADER "#define CONFIG_MEMORYSTATUS 1\n";
-		} else {
-			printf HEADER "/* #undef CONFIG_MEMORYSTATUS */\n";
+		if (defined($features{"FEATURE_SMALL_STDIOBUF"})) {
+			printf HEADER "#define FEATURE_SMALL_STDIOBUF 1\n";
+		} else {
+			printf HEADER "/* #undef FEATURE_SMALL_STDIOBUF */\n";
+		}
+
+		if (defined($features{"FEATURE_XPRINTF_PERF"})) {
+			printf HEADER "#define XPRINTF_PERF 1\n";
+		} else {
+			printf HEADER "/* #undef XPRINTF_PERF */\n";
 		}
 
 		printf HEADER "#endif // _LIBC_FEATURES_H_\n";