diff options
Diffstat (limited to 'scripts/gen-sorted.awk')
-rwxr-xr-x | scripts/gen-sorted.awk | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/scripts/gen-sorted.awk b/scripts/gen-sorted.awk index 922eafcc2d..ecbed9ef43 100755 --- a/scripts/gen-sorted.awk +++ b/scripts/gen-sorted.awk @@ -46,36 +46,10 @@ type == "Subdirs" && NF == 2 && $1 == "inhibit" { type == "Subdirs" && thisdir { all[cnt++] = thisdir; - if (FILENAME ~ (srcpfx ? /^\.\.\/sysdeps\// : /^sysdeps\//) \ - || system("test -d " srcpfx thisdir) == 0) { - # This Subdirs file is in the main source tree, - # or this subdirectory exists in the main source tree. - this_srcdir = srcpfx thisdir - } - else { - # The Subdirs file comes from an add-on that should have the subdirectory. - dir = FILENAME; - do - sub(/\/[^/]+$/, "", dir); - while (dir !~ /\/sysdeps$/); - sub(/\/sysdeps$/, "", dir); - if (system("test -d " dir "/" thisdir) == 0) - dir = dir "/" thisdir; - else { - sub(/\/[^/]+$/, "", dir); - if (system("test -d " dir "/" thisdir) == 0) - dir = dir "/" thisdir; - else { - print FILENAME ":" FNR ":", "cannot find", thisdir > "/dev/stderr"; - exit 2 - } - } - file = dir "/Depend"; - if (srcpfx) - sub(/^\.\.\//, "", dir); - if (dir !~ /^\/.*$/) - dir = "$(..)" dir; - print thisdir "-srcdir", ":=", dir; + this_srcdir = srcpfx thisdir + if (system("test -d " this_srcdir) != 0) { + print FILENAME ":" FNR ":", "cannot find", this_srcdir > "/dev/stderr"; + exit 2 } file = this_srcdir "/Depend"; if (system("test -f " file) == 0) { |