@@ -342,13 +342,40 @@ $(LIBRUBY_$(LIBRUBY_WITH_EXT)): $(LIBRUBY_SO_UPDATE)
342342PKG_CONFIG = @PKG_CONFIG@
343343ruby_pc = @ruby_pc@
344344$(ruby_pc ) : config.status Makefile
345- $(Q ) ./config.status --file=-:$(srcdir ) /template/ruby.pc.in | \
345+ $(Q ) \
346+ pkg=" $( @libdirname@) /pkgconfig" prefix=" $( prefix) " ; \
347+ if [ " $( LIBRUBY_RELATIVE) " = yes ]; then \
348+ case " $$ pkg" in " $$ prefix" /?* ) \
349+ pkg=" $$ {pkg#$$ prefix/}" ; \
350+ prefix=' $${pcfiledir}' ` echo " /$$ {pkg}" | sed -e ' s|/[^/][^/]*|/..|g' ` ; \
351+ esac ; \
352+ fi ; \
353+ ./config.status --file=-:$(srcdir ) /template/ruby.pc.in | \
346354 sed -e ' s/\$$(\([A-Za-z_][A-Za-z0-9_]*\))/$${\1}/g' \
347- -e ' s|^prefix=.*|prefix=$( prefix)| ' \
355+ -e " s|^prefix=.*|prefix=$$ prefix| " \
348356 > ruby.tmp.pc
349357 $(Q ) pkg_config=${PKG_CONFIG} && PKG_CONFIG_PATH=. $$ {pkg_config:-:} --print-errors ruby.tmp
350358 $(Q )$(MV ) -f ruby.tmp.pc $(ruby_pc )
351359
360+ test-pc : install-data
361+ set -ex; \
362+ [ -z " $$ {pkg_config=$( PKG_CONFIG) }" ] && exit ; \
363+ export PKG_CONFIG_PATH=$(DESTDIR ) /$(libdir ) /pkgconfig$$ {PKG_CONFIG_PATH:+:$$ PKG_CONFIG_PATH}; \
364+ $$ {pkg_config} --exists $(ruby_pc:.pc= ) ; \
365+ path=` $$ {pkg_config} --variable=prefix $( ruby_pc:.pc=) ` ; \
366+ if [ " $( LIBRUBY_RELATIVE) " = yes ]; then \
367+ test " $$ path" -ef " $( DESTDIR) $( prefix) " ; \
368+ else \
369+ test " $$ path" = " $( prefix) " ; \
370+ fi
371+
372+ install-data : pkgconfig-data pre-install-data do-install-data post-install-data
373+ pre-install-data :: install-prereq
374+ do-install-data : $(PREP ) pre-install-data
375+ $(INSTRUBY ) --make=" $( MAKE) " $(INSTRUBY_ARGS ) --install=data
376+ post-install-data ::
377+ @$(NULLCMD )
378+
352379modular-gc-precheck :
353380 $(Q ) if test -z $( modular_gc_dir) ; then \
354381 echo " You must configure with --with-modular-gc to use modular GC" ; \
0 commit comments