summaryrefslogtreecommitdiff
path: root/template/Makefile.in
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-29 14:08:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-29 14:08:53 +0900
commit7487371eeb599f1e5568f0a7cdc12bdb0fa550a0 (patch)
tree45b73eb50a40bd7808fd3bfd145058fb2b471e2f /template/Makefile.in
parent623736ae7f327015e23fbdb8f847a8424a3dd73a (diff)
Make ruby.pc from make
Expand variables undefined in configure.ac, RUBY_RELEASE_DATE and so on.
Diffstat (limited to 'template/Makefile.in')
-rw-r--r--template/Makefile.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/template/Makefile.in b/template/Makefile.in
index c382159da5..666cbc3481 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -315,10 +315,18 @@ $(LIBRUBY_SO):
LIBRUBY_WITH_EXT = @LIBRUBY_WITH_EXT@
$(LIBRUBY_$(LIBRUBY_WITH_EXT)): $(LIBRUBY_SO_UPDATE)
+PKG_CONFIG = @PKG_CONFIG@
ruby_pc = @ruby_pc@
ruby.pc: $(ruby_pc)
-$(ruby_pc): config.status
- @./config.status --file=$@:$(srcdir)/template/ruby.pc.in
+$(ruby_pc): config.status Makefile
+ $(Q)./config.status --file=-:$(srcdir)/template/ruby.pc.in | \
+ sed -e 's/\$$(\([A-Za-z_][A-Za-z0-9_]*\))/$${\1}/g' \
+ -e 's|^prefix=.*|prefix=$(prefix)|' \
+ > ruby.tmp.pc
+ $(Q)pkg_config=${PKG_CONFIG} && PKG_CONFIG_PATH=. $${pkg_config:-:} --print-errors ruby.tmp
+ $(Q)$(MV) -f ruby.tmp.pc $(ruby_pc)
+
+pre-install-local:: pkgconfig-data
ruby-runner.h: template/ruby-runner.h.in config.status
@./config.status --file=$@:$(srcdir)/template/$(@F).in
@@ -328,7 +336,7 @@ $(RBCONFIG): $(PREP)
rbconfig.rb: $(RBCONFIG)
install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
- $(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
+ $(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE) pkgconfig-data
$(ECHO) installing cross-compiling stuff
$(Q) $(MAKEDIRS) $(XRUBY_RUBYLIBDIR)/$(arch) $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
$(Q) sed '/^\$$:\.unshift/q' $(arch)-fake.rb > fake.rb