summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/fiddle/extlibs2
-rwxr-xr-xtool/extlibs.rb16
2 files changed, 18 insertions, 0 deletions
diff --git a/ext/fiddle/extlibs b/ext/fiddle/extlibs
index 85490ea03b..d2a2ed32ff 100644
--- a/ext/fiddle/extlibs
+++ b/ext/fiddle/extlibs
@@ -10,3 +10,5 @@ https://ftp.osuosl.org/pub/blfs/conglomeration/libffi/$(pkg).tar.gz \
$(pkg)/config.guess -> /tool/config.guess
$(pkg)/config.sub -> /tool/config.sub
+
+! chdir: $(pkg)| autoconf
diff --git a/tool/extlibs.rb b/tool/extlibs.rb
index 720f1c767d..8a9c5a8fd0 100755
--- a/tool/extlibs.rb
+++ b/tool/extlibs.rb
@@ -125,6 +125,15 @@ class ExtLibs
end
end
+ def do_exec(command, dir, dest)
+ dir = dir ? File.join(dest, dir) : dest
+ if $VERBOSE
+ $stdout.puts "running #{command.dump} under #{dir}"
+ $stdout.flush
+ end
+ system(command, chdir: dir) or raise "failed #{command.dump}"
+ end
+
def do_command(mode, dest, url, cache_dir, chksums)
extracted = false
base = /.*(?=\.tar(?:\.\w+)?\z)/
@@ -206,6 +215,13 @@ class ExtLibs
do_patch(dest, patch, args)
end
next
+ elsif /^!\s*(?:chdir:\s*([^|\s]+)\|\s*)?(.*)/ =~ line
+ if extracted and (mode == :all or mode == :patch)
+ command = vars.expand($2.strip)
+ chdir = $1 and chdir = vars.expand(chdir)
+ do_exec(command, chdir, dest)
+ end
+ next
elsif /->/ =~ line
if extracted and (mode == :all or mode == :patch)
link, file = $`.strip, $'.strip