pkgsrc/mk/configure/pkg-config-override.mk
jlam e31200b87c Refactor configure, build, test and wrapper phases out of bsd.pkg.mk
and into their own directories.  Also do some cleanups with build/_build
and pkginstall -- we get rid of _build and simply run pkginstall as
part of the "build" target.

Introduce a new mechanism to handle varying directory depths under
${WRKSRC} in which we find files to override, e.g. configure, config.*,
libtool, etc.  OVERRIDE_DIRDEPTH is a package-settable variable that
specifies how far under ${WRKSRC} the various targets should look,
and it defaults to "2".  We preserve the
meaning of the various *_OVERRIDE variables, so if they are defined,
then their values supersede the OVERRIDE_DIRDEPTH mechanism.

devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log
for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
2006-07-05 06:09:15 +00:00

33 lines
1.2 KiB
Makefile

# $NetBSD: pkg-config-override.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $
######################################################################
### pkg-config-override (PRIVATE)
######################################################################
### pkg-config-override inserts the compiler's "rpath" flag into
### pkg-config data files so that ``pkg-config --ldflags <module>'' will
### return the full set of compiler flags needed to find libraries at
### run-time.
###
.PHONY: pkg-config-override
pkg-config-override:
@${DO_NADA}
.if defined(_USE_RPATH) && !empty(_USE_RPATH:M[nN][oO])
pkg-config-override: subst-pkgconfig
PKGCONFIG_OVERRIDE_SED= \
'/^Libs:.*[ ]/s|-L\([ ]*[^ ]*\)|${COMPILER_RPATH_FLAG}\1 -L\1|g'
PKGCONFIG_OVERRIDE_STAGE?= pre-configure
SUBST_CLASSES+= pkgconfig
. if ${PKGCONFIG_OVERRIDE_STAGE} == "pre-configure"
SUBST_STAGE.pkgconfig= do-configure-pre-hook
. elif ${PKGCONFIG_OVERRIDE_STAGE} == "post-configure"
SUBST_STAGE.pkgconfig= do-configure-post-hook
. else
SUBST_STAGE.pkgconfig= ${PKGCONFIG_OVERRIDE_STAGE}
. endif
SUBST_MESSAGE.pkgconfig= Adding run-time search paths to pkg-config files.
SUBST_FILES.pkgconfig= ${PKGCONFIG_OVERRIDE:S/^${WRKSRC}\///}
SUBST_SED.pkgconfig= ${PKGCONFIG_OVERRIDE_SED}
.endif