From fc577e353825d59fbadb53af48e7bf00f7e19395 Mon Sep 17 00:00:00 2001 From: hans Date: Tue, 4 Oct 2011 14:23:17 +0000 Subject: Add a builtin.mk to allow using a native libuuid if available. --- devel/libuuid/builtin.mk | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 devel/libuuid/builtin.mk (limited to 'devel/libuuid') diff --git a/devel/libuuid/builtin.mk b/devel/libuuid/builtin.mk new file mode 100644 index 00000000000..fb43240df12 --- /dev/null +++ b/devel/libuuid/builtin.mk @@ -0,0 +1,45 @@ +# $NetBSD: builtin.mk,v 1.1 2011/10/04 14:23:17 hans Exp $ + +BUILTIN_PKG:= libuuid + +BUILTIN_FIND_FILES_VAR= H_UUID +BUILTIN_FIND_FILES.H_UUID= /usr/include/uuid/uuid.h +BUILTIN_FIND_GREP.H_UUID= uuid_generate +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__) + +IS_BUILTIN.libuuid= yes +USE_BUILTIN.libuuid= yes +BUILTIN_PKG.libuuid= libuuid-2.18 # whatever, as long as it is big enough + +. if !empty(USE_TOOLS:C/:.*//:Mpkg-config) +do-configure-pre-hook: override-libuuid-pkgconfig + +BLKDIR_PKGCFG= ${BUILDLINK_DIR}/lib/pkgconfig +LIBUUID_PKGCFGF= uuid.pc + +override-libuuid-pkgconfig: override-message-libuuid-pkgconfig +override-message-libuuid-pkgconfig: + @${STEP_MSG} "Magical transformations for libuuid on Solaris." + +override-libuuid-pkgconfig: + ${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}; +. endif +.endif -- cgit v1.2.3