diff options
author | sbd <sbd@pkgsrc.org> | 2011-11-30 07:57:09 +0000 |
---|---|---|
committer | sbd <sbd@pkgsrc.org> | 2011-11-30 07:57:09 +0000 |
commit | 6771ad10dbe4303b5f2acfd75dce5a9620bc4a13 (patch) | |
tree | 381934392f716c6f9655eb20d66b76a5c7a4b18a /devel | |
parent | dc420b582c28dd5c78221ab938d803e49c78184e (diff) | |
download | pkgsrc-6771ad10dbe4303b5f2acfd75dce5a9620bc4a13.tar.gz |
Modify the builtin.mk file so it matches the template in
pkgsrc/mk/buildlink3/bsd.builtin.mk and change the fake uuid.pc so its
similar to what's used in other builtins (and a little bit simpler).
Diffstat (limited to 'devel')
-rw-r--r-- | devel/libuuid/builtin.mk | 92 |
1 files changed, 64 insertions, 28 deletions
diff --git a/devel/libuuid/builtin.mk b/devel/libuuid/builtin.mk index fb43240df12..80429cc1403 100644 --- a/devel/libuuid/builtin.mk +++ b/devel/libuuid/builtin.mk @@ -1,4 +1,4 @@ -# $NetBSD: builtin.mk,v 1.1 2011/10/04 14:23:17 hans Exp $ +# $NetBSD: builtin.mk,v 1.2 2011/11/30 07:57:09 sbd Exp $ BUILTIN_PKG:= libuuid @@ -9,37 +9,73 @@ BUILTIN_FIND_LIBS:= uuid .include "../../mk/buildlink3/bsd.builtin.mk" -.if !empty(BUILTIN_LIB_FOUND.uuid:M[yY][eE][sS]) && \ - empty(H_UUID:M__nonexistent__) - +## +## Determine if there is a built-in implementation of the package and +## set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). +## +.if !defined(IS_BUILTIN.libuuid) +IS_BUILTIN.libuuid= no +. if !empty(BUILTIN_LIB_FOUND.uuid:M[yY][eE][sS]) && \ + empty(H_UUID:M__nonexistent__) IS_BUILTIN.libuuid= yes -USE_BUILTIN.libuuid= yes -BUILTIN_PKG.libuuid= libuuid-2.18 # whatever, as long as it is big enough +. endif +.endif +MAKEVARS+= IS_BUILTIN.libuuid -. if !empty(USE_TOOLS:C/:.*//:Mpkg-config) -do-configure-pre-hook: override-libuuid-pkgconfig +### +### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to +### a package name to represent the built-in package. +### +.if !defined(BUILTIN_PKG.libuuid) && \ + !empty(IS_BUILTIN.libuuid:M[yY][eE][sS]) +BUILTIN_PKG.libuuid= libuuid-2.18 # whatever, as long as it is big enough +.endif -BLKDIR_PKGCFG= ${BUILDLINK_DIR}/lib/pkgconfig -LIBUUID_PKGCFGF= uuid.pc +### +### Determine whether we should use the built-in implementation if it +### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). +### +.if !defined(USE_BUILTIN.libuuid) +. if ${PREFER.libuuid} == "pkgsrc" +USE_BUILTIN.libuuid= no +. else +USE_BUILTIN.libuuid= ${IS_BUILTIN.libuuid} +. if defined(BUILTIN_PKG.libuuid) && \ + !empty(IS_BUILTIN.libuuid:M[yY][eE][sS]) +USE_BUILTIN.libuuid= yes +. for _dep_ in ${BUILDLINK_API_DEPENDS.libuuid} +. if !empty(USE_BUILTIN.libuuid:M[yY][eE][sS]) +USE_BUILTIN.libuuid!= \ + if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.libuuid:Q}; then \ + ${ECHO} yes; \ + else \ + ${ECHO} no; \ + fi +. endif +. endfor +. endif +. endif +.endif +MAKEVARS+= USE_BUILTIN.libuuid -override-libuuid-pkgconfig: override-message-libuuid-pkgconfig -override-message-libuuid-pkgconfig: - @${STEP_MSG} "Magical transformations for libuuid on Solaris." +### +### The section below only applies if we are not including this file +### solely to determine whether a built-in implementation exists. +### +CHECK_BUILTIN.libuuid?= no +.if !empty(CHECK_BUILTIN.libuuid:M[nN][oO]) +. if !empty(USE_BUILTIN.libuuid:M[yY][eE][sS]) && \ + !empty(USE_TOOLS:C/:.*//:Mpkg-config) +BUILDLINK_TARGETS+= libuuid-fake-pc -override-libuuid-pkgconfig: +libuuid-fake-pc: ${RUN} \ - ${MKDIR} ${BLKDIR_PKGCFG}; \ - { \ - ${ECHO} "prefix=/usr"; \ - ${ECHO} "exec_prefix=\$${prefix}"; \ - ${ECHO} "libdir=\$${exec_prefix}/lib"; \ - ${ECHO} "includedir=\$${prefix}/include"; \ - ${ECHO} ""; \ - ${ECHO} "Name: uuid"; \ - ${ECHO} "Description: Universally unique id library"; \ - ${ECHO} "Version: ${BUILTIN_VERSION.libuuid}"; \ - ${ECHO} "Libs: -Wl,-R\$${libdir} -L\$${libdir} -luuid"; \ - ${ECHO} "Cflags: -I\$${includedir}"; \ - } >> ${BLKDIR_PKGCFG}/${LIBUUID_PKGCFGF}; + ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig; \ + { ${ECHO} "Name: uuid"; \ + ${ECHO} "Description: Universally unique id library"; \ + ${ECHO} "Version: ${BUILTIN_VERSION.libuuid}"; \ + ${ECHO} "Libs: -L/usr/lib -luuid" \ + ${ECHO} "Cflags: -I/usr/include"; \ + } >${BUILDLINK_DIR}/lib/pkgconfig/uuid.pc . endif -.endif +.endif # CHECK_BUILTIN.libuuid |