ODPM 266: Go-libmemif + 2 examples.
[govpp.git] / vendor / golang.org / x / sys / unix / linux / mksysnum.pl
similarity index 78%
rename from vendor/golang.org/x/sys/unix/mksysnum_linux.pl
rename to vendor/golang.org/x/sys/unix/linux/mksysnum.pl
index 872ae8c..63fd800 100755 (executable)
@@ -10,11 +10,18 @@ if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
        exit 1;
 }
 
-my $command = "mksysnum_linux.pl ". join(' ', @ARGV);
+# Check that we are using the new build system if we should
+if($ENV{'GOLANG_SYS_BUILD'} ne "docker") {
+       print STDERR "In the new build system, mksysnum should not be called directly.\n";
+       print STDERR "See README.md\n";
+       exit 1;
+}
+
+my $command = "$0 ". join(' ', @ARGV);
 
 print <<EOF;
 // $command
-// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
+// Code generated by the command above; see README.md. DO NOT EDIT.
 
 // +build $ENV{'GOARCH'},$ENV{'GOOS'}
 
@@ -38,8 +45,8 @@ sub fmt {
 }
 
 my $prev;
-open(GCC, "gcc -E -dD @ARGV |") || die "can't run gcc";
-while(<GCC>){
+open(CC, "$ENV{'CC'} -E -dD @ARGV |") || die "can't run $ENV{'CC'}";
+while(<CC>){
        if(/^#define __NR_Linux\s+([0-9]+)/){
                # mips/mips64: extract offset
                $offset = $1;