Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/libuuid_ul/lib/libuuid_ul build glue libuuid_ul...



details:   https://anonhg.NetBSD.org/src/rev/87b820b4261a
branches:  trunk
changeset: 449433:87b820b4261a
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Mar 07 03:53:51 2019 +0000

description:
build glue libuuid_ul from util-linux's libuuid, with renamed functions,
as a private library so that fontconfig can link it in.

provide a randutils.h compat as the generic util-linux one is GPL.

diffstat:

 external/bsd/libuuid_ul/lib/libuuid_ul/Makefile             |  40 +++++++++++
 external/bsd/libuuid_ul/lib/libuuid_ul/libuuid_ul-rename.mk |  16 ++++
 external/bsd/libuuid_ul/lib/libuuid_ul/randutils.h          |  44 +++++++++++++
 3 files changed, 100 insertions(+), 0 deletions(-)

diffs (112 lines):

diff -r c07cf2f4a386 -r 87b820b4261a external/bsd/libuuid_ul/lib/libuuid_ul/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libuuid_ul/lib/libuuid_ul/Makefile   Thu Mar 07 03:53:51 2019 +0000
@@ -0,0 +1,40 @@
+#      $NetBSD: Makefile,v 1.1 2019/03/07 03:53:51 mrg Exp $
+
+# Makefile to build minimal util-linux libuuid locally, with special
+# prefix on all functions to avoid conflicts with libc uuid_compare(3).
+#
+
+LIB=   uuid_ul
+SRCS=  compare.c copy.c \
+       gen_uuid.c \
+       pack.c parse.c \
+       unpack.c unparse.c
+
+CPPFLAGS+= \
+       -DHAVE_UNISTD_H \
+       -DHAVE_STDLIB_H \
+       -DHAVE_SYS_TIME_H \
+       -DHAVE_SYS_FILE_H \
+       -DHAVE_SYS_IOCTL_H \
+       -DHAVE_SYS_SOCKET_H \
+       -DHAVE_SYS_SOCKIO_H \
+       -DHAVE_SYS_SOCKIO_H \
+       -DHAVE_NETINET_IN_H \
+       -DHAVE_SYS_UN_H \
+       -DHAVE_TLS \
+       -DHAVE_NET_IF_H \
+       -DHAVE_NET_IF_DL_H \
+       -DHAVE_SA_LEN
+
+CPPFLAGS+= \
+       -I${.CURDIR} \
+       -DUL_CLOEXECSTR=\"e\" \
+       -DUUIDD_OP_BULK_TIME_UUID=0
+
+.include "libuuid_ul-rename.mk"
+
+LIBISPRIVATE=  yes
+
+.include <bsd.lib.mk>
+
+.PATH: ${X11SRCDIR}/external/bsd/libuuid_ul/dist
diff -r c07cf2f4a386 -r 87b820b4261a external/bsd/libuuid_ul/lib/libuuid_ul/libuuid_ul-rename.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libuuid_ul/lib/libuuid_ul/libuuid_ul-rename.mk       Thu Mar 07 03:53:51 2019 +0000
@@ -0,0 +1,16 @@
+#      $NetBSD: libuuid_ul-rename.mk,v 1.1 2019/03/07 03:53:51 mrg Exp $
+
+#
+# functions exported by fontconfig's private libuuid copy are
+# renamed to have a "ul_" prefix (from util-linux).  listed here
+# so that both the libuuid_ul build and fontconfig can find them.
+#
+
+RENAME_FUNCS= \
+       uuid_compare uuid_copy \
+       uuid_generate uuid_generate_random \
+       uuid_parse uuid_unparse \
+       uuid_pack uuid_unpack
+.for _f in ${RENAME_FUNCS}
+CPPFLAGS+= -D${_f}=ul_${_f}
+.endfor
diff -r c07cf2f4a386 -r 87b820b4261a external/bsd/libuuid_ul/lib/libuuid_ul/randutils.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libuuid_ul/lib/libuuid_ul/randutils.h        Thu Mar 07 03:53:51 2019 +0000
@@ -0,0 +1,44 @@
+/*     $NetBSD: randutils.h,v 1.1 2019/03/07 03:53:51 mrg Exp $        */
+
+/*
+ * Copyright (c) 2019 Matthew R. Green
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef NETBSD_SHIM_RANDUTILS
+#define NETBSD_SHIM_RANDUTILS
+
+/* shim function for util-linux random_get_bytes() */
+
+#include <stdlib.h>
+
+static void __inline__
+random_get_bytes(void *buf, size_t nbytes)
+{
+       arc4random_buf(buf, nbytes);
+}
+
+#endif



Home | Main Index | Thread Index | Old Index