[前][次][番号順一覧][スレッド一覧]

ruby-changes:67281

From: Nobuyoshi <ko1@a...>
Date: Sun, 29 Aug 2021 15:12:43 +0900 (JST)
Subject: [ruby-changes:67281] 7487371eeb (master): Make ruby.pc from make

https://git.ruby-lang.org/ruby.git/commit/?id=7487371eeb

From 7487371eeb599f1e5568f0a7cdc12bdb0fa550a0 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 29 Aug 2021 14:08:53 +0900
Subject: Make ruby.pc from make

Expand variables undefined in configure.ac, RUBY_RELEASE_DATE and
so on.
---
 configure.ac         | 15 ---------------
 template/Makefile.in | 14 +++++++++++---
 2 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index fa15417..c83145f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4272,21 +4272,6 @@ AC_ARG_WITH(destdir, https://github.com/ruby/ruby/blob/trunk/configure.ac#L4272
 	    [DESTDIR="$withval"])
 AC_SUBST(DESTDIR)
 
-AC_CONFIG_FILES($ruby_pc:template/ruby.pc.in,
-    [
-    AS_IF([sed ['s/\$(\([A-Za-z_][A-Za-z0-9_]*\))/${\1}/g;s/@[A-Za-z_][A-Za-z0-9_]*@//'] $ruby_pc > ruby.tmp.pc &&
-	{
-	    test -z "$PKG_CONFIG" ||
-	    PKG_CONFIG_PATH=. $PKG_CONFIG --print-errors ruby.tmp
-	}],
-    [
-	mv -f ruby.tmp.pc $ruby_pc
-    ], [
-	exit 1
-    ])
-    ],
-    [ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
-
 AC_OUTPUT
 }
 }
diff --git a/template/Makefile.in b/template/Makefile.in
index c382159..666cbc3 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -315,10 +315,18 @@ $(LIBRUBY_SO): https://github.com/ruby/ruby/blob/trunk/template/Makefile.in#L315
 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) https://github.com/ruby/ruby/blob/trunk/template/Makefile.in#L336
 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
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]