@@ -350,13 +350,40 @@ $(LIBRUBY_$(LIBRUBY_WITH_EXT)): $(LIBRUBY_SO_UPDATE)
350350PKG_CONFIG = @PKG_CONFIG@
351351ruby_pc = @ruby_pc@
352352$(ruby_pc ) : config.status Makefile
353- $(Q ) ./config.status --file=-:$(srcdir ) /template/ruby.pc.in | \
353+ $(Q ) \
354+ pkg=" $( @libdirname@) /pkgconfig" prefix=" $( prefix) " ; \
355+ if [ " $( LIBRUBY_RELATIVE) " = yes ]; then \
356+ case " $$ pkg" in " $$ prefix" /?* ) \
357+ pkg=" $$ {pkg#$$ prefix/}" ; \
358+ prefix=' $${pcfiledir}' ` echo " /$$ {pkg}" | sed -e ' s|/[^/][^/]*|/..|g' ` ; \
359+ esac ; \
360+ fi ; \
361+ ./config.status --file=-:$(srcdir ) /template/ruby.pc.in | \
354362 sed -e ' s/\$$(\([A-Za-z_][A-Za-z0-9_]*\))/$${\1}/g' \
355- -e ' s|^prefix=.*|prefix=$( prefix)| ' \
363+ -e " s|^prefix=.*|prefix=$$ prefix| " \
356364 > ruby.tmp.pc
357365 $(Q ) pkg_config=${PKG_CONFIG} && PKG_CONFIG_PATH=. $$ {pkg_config:-:} --print-errors ruby.tmp
358366 $(Q )$(MV ) -f ruby.tmp.pc $(ruby_pc )
359367
368+ test-pc : install-data
369+ set -ex; \
370+ [ -z " $$ {pkg_config=$( PKG_CONFIG) }" ] && exit ; \
371+ export PKG_CONFIG_PATH=$(DESTDIR ) /$(libdir ) /pkgconfig$$ {PKG_CONFIG_PATH:+:$$ PKG_CONFIG_PATH}; \
372+ $$ {pkg_config} --exists $(ruby_pc:.pc= ) ; \
373+ path=` $$ {pkg_config} --variable=prefix $( ruby_pc:.pc=) ` ; \
374+ if [ " $( LIBRUBY_RELATIVE) " = yes ]; then \
375+ test " $$ path" -ef " $( DESTDIR) $( prefix) " ; \
376+ else \
377+ test " $$ path" = " $( prefix) " ; \
378+ fi
379+
380+ install-data : pkgconfig-data pre-install-data do-install-data post-install-data
381+ pre-install-data :: install-prereq
382+ do-install-data : $(PREP ) pre-install-data
383+ $(INSTRUBY ) --make=" $( MAKE) " $(INSTRUBY_ARGS ) --install=data
384+ post-install-data ::
385+ @$(NULLCMD )
386+
360387modular-gc-precheck :
361388 $(Q ) if test -z $( modular_gc_dir) ; then \
362389 echo " You must configure with --with-modular-gc to use modular GC" ; \
0 commit comments