Module Name: src
Committed By: mrg
Date: Sun Jan 29 07:54:11 UTC 2023
Added Files:
src/external/mit/xorg/lib/brotli: brotli-rename.mk brotli.mk
Log Message:
build framework for embedded brotli.
need to figure out a way to handle tools build vs installed build
before we can enable it in freetype itself.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/mit/xorg/lib/brotli/brotli-rename.mk \
src/external/mit/xorg/lib/brotli/brotli.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: src/external/mit/xorg/lib/brotli/brotli-rename.mk
diff -u /dev/null src/external/mit/xorg/lib/brotli/brotli-rename.mk:1.1
--- /dev/null Sun Jan 29 07:54:11 2023
+++ src/external/mit/xorg/lib/brotli/brotli-rename.mk Sun Jan 29 07:54:11 2023
@@ -0,0 +1,41 @@
+# $NetBSD: brotli-rename.mk,v 1.1 2023/01/29 07:54:11 mrg Exp $
+
+#
+# functions exported by freetype's private brotli copy are renamed to have
+# a "nbft_" prefix.
+#
+
+RENAME_FUNCS= \
+ BrotliBuildCodeLengthsHuffmanTable \
+ BrotliBuildHuffmanTable \
+ BrotliBuildSimpleHuffmanTable \
+ BrotliDecoderCreateInstance \
+ BrotliDecoderDecompress \
+ BrotliDecoderDecompressStream \
+ BrotliDecoderDestroyInstance \
+ BrotliDecoderErrorString \
+ BrotliDecoderGetErrorCode \
+ BrotliDecoderHasMoreOutput \
+ BrotliDecoderHuffmanTreeGroupInit \
+ BrotliDecoderIsFinished \
+ BrotliDecoderIsUsed \
+ BrotliDecoderSetParameter \
+ BrotliDecoderStateCleanup \
+ BrotliDecoderStateCleanupAfterMetablock \
+ BrotliDecoderStateInit \
+ BrotliDecoderStateMetablockBegin \
+ BrotliDecoderTakeOutput \
+ BrotliDecoderVersion \
+ BrotliDefaultAllocFunc \
+ BrotliDefaultFreeFunc \
+ BrotliGetDictionary \
+ BrotliGetTransforms \
+ BrotliInitBitReader \
+ BrotliSafeReadBits32Slow \
+ BrotliSetDictionaryData \
+ BrotliTransformDictionaryWord \
+ BrotliWarmupBitReader \
+
+.for _f in ${RENAME_FUNCS}
+CPPFLAGS+= -D${_f}=nbft_${_f}
+.endfor
Index: src/external/mit/xorg/lib/brotli/brotli.mk
diff -u /dev/null src/external/mit/xorg/lib/brotli/brotli.mk:1.1
--- /dev/null Sun Jan 29 07:54:11 2023
+++ src/external/mit/xorg/lib/brotli/brotli.mk Sun Jan 29 07:54:11 2023
@@ -0,0 +1,24 @@
+# $NetBSD: brotli.mk,v 1.1 2023/01/29 07:54:11 mrg Exp $
+
+# makefile fragment to build brotlidec for freetype2
+
+.include "bsd.own.mk"
+
+BROTLI_SRCS= bit_reader.c decode.c huffman.c state.c
+BROTLI_SRCS+= constants.c context.c dictionary.c platform.c transform.c
+
+SRCS+= ${BROTLI_SRCS}
+
+.for _f in ${BROTLI_SRCS}
+CFLAGS.${_f}+= -fcommon
+CPPFLAGS+${_f}= -DBROTLIDEC_SHARED_COMPILATION \
+ -DBROTLI_HAVE_LOG2=1 \
+ -DBROTLI_SHARED_COMPILATION \
+ -DNDEBUG \
+ -I${X11SRCDIR.brotli}/c/include
+.endfor
+
+.include "brotli-rename.mk"
+
+.PATH: ${X11SRCDIR.brotli}/c/dec
+.PATH: ${X11SRCDIR.brotli}/c/common