summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2013-01-07 08:04:56 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2013-02-05 18:54:15 +0100
commitb4c224b6f93802ff2adfec4a86a554a7ee05246d (patch)
tree82e84719d8f3ec00fa3eb3c621cd5d9184e472a8
parent5dcb669dff2d8da2d914019fb46441f8807b4d97 (diff)
downloadptxdist-b4c224b6f93802ff2adfec4a86a554a7ee05246d.tar.gz
ptxdist-b4c224b6f93802ff2adfec4a86a554a7ee05246d.tar.xz
ustr: add package
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch61
-rw-r--r--patches/ustr-1.0.4/series4
-rw-r--r--rules/ustr.in9
-rw-r--r--rules/ustr.make61
4 files changed, 135 insertions, 0 deletions
diff --git a/patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch b/patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch
new file mode 100644
index 000000000..b4612f40a
--- /dev/null
+++ b/patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch
@@ -0,0 +1,61 @@
+From: Wolfram Sang <w.sang@pengutronix.de>
+Date: Mon, 14 Jan 2013 13:20:11 +0100
+Subject: [PATCH] makefile: make it possible to overwrite binary checks
+
+ustr tries to determine 64bit and vsnprintf features by compiling and running
+test programs. Use value defined in ptxdist. Assume stdint.h as always there,
+as we are on linux.
+
+Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ Makefile | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7a0f317..9eab99b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -457,12 +457,24 @@ ustr-import: ustr-import.in autoconf_64b autoconf_vsnprintf
+
+ # Use CFLAGS so that CFLAGS="... -m32" does the right thing
+ autoconf_64b: autoconf_64b.c
++ifdef SZ64
++ $(HIDE)echo "Faking: auto configuration test: 64bit=$(SZ64)"
++ $(HIDE)echo "echo $(SZ64)" > $@
++ $(HIDE)chmod +x $@
++else
+ $(HIDE)echo Compiling: auto configuration test: 64bit
+ $(HIDE)$(CC) $(CFLAGS) -o $@ $<
++endif
+
+ autoconf_vsnprintf: autoconf_vsnprintf.c
++ifdef VSNP
++ $(HIDE)echo "Faking: auto configuration test: vsnprintf=$(VSNP)"
++ $(HIDE)echo "echo $(VSNP)" > $@
++ $(HIDE)chmod +x $@
++else
+ $(HIDE)echo Compiling: auto configuration test: vsnprintf
+ $(HIDE)$(CC) -o $@ $<
++endif
+
+ # Use LDFLAGS for LDFLAGS="-m32"
+ $(OPT_LIB_SHARED): $(LIB_SHARED_OPT)
+@@ -484,7 +496,7 @@ libustr-debug.a: $(LIB_STATIC_DBG)
+
+ ustr-conf.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
+ $(HIDE)echo Creating $@
+- $(HIDE)have_stdint_h=0; dbg1=0; dbg2=0; \
++ $(HIDE)have_stdint_h=1; dbg1=0; dbg2=0; \
+ sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
+ if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
+ if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
+@@ -493,7 +505,7 @@ ustr-conf.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
+
+ ustr-conf-debug.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
+ $(HIDE)echo Creating $@
+- $(HIDE)have_stdint_h=0; dbg1=1; dbg2=1; \
++ $(HIDE)have_stdint_h=1; dbg1=1; dbg2=1; \
+ sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
+ if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
+ if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
diff --git a/patches/ustr-1.0.4/series b/patches/ustr-1.0.4/series
new file mode 100644
index 000000000..bfc4ebcba
--- /dev/null
+++ b/patches/ustr-1.0.4/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-makefile-make-it-possible-to-overwrite-binary-checks.patch
+# 97ea3dd36786e59cf2ebe686fbe22301 - git-ptx-patches magic
diff --git a/rules/ustr.in b/rules/ustr.in
new file mode 100644
index 000000000..5546f564b
--- /dev/null
+++ b/rules/ustr.in
@@ -0,0 +1,9 @@
+## SECTION=system_libraries
+
+config USTR
+ tristate
+ prompt "ustr"
+ help
+ ustr (Micro string library) is a string API for C. It has tiny overhead over
+ just plain strdup(), is much safer, is easier to use, is faster for many
+ operations, can be used with read-only or automatically allocated data.
diff --git a/rules/ustr.make b/rules/ustr.make
new file mode 100644
index 000000000..c313e71b7
--- /dev/null
+++ b/rules/ustr.make
@@ -0,0 +1,61 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2012 by Wolfram Sang <w.sang@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_USTR) += ustr
+
+#
+# Paths and names
+#
+USTR_VERSION := 1.0.4
+USTR_MD5 := 93147d9f0c9765d4cd0f04f7e44bdfce
+USTR := ustr-$(USTR_VERSION)
+USTR_SUFFIX := tar.bz2
+USTR_URL := http://www.and.org/ustr/$(USTR_VERSION)/$(USTR).$(USTR_SUFFIX)
+USTR_SOURCE := $(SRCDIR)/$(USTR).$(USTR_SUFFIX)
+USTR_DIR := $(BUILDDIR)/$(USTR)
+USTR_LICENSE := LGPLv2+,MIT,BSD
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+USTR_CONF_TOOL := NO
+USTR_MAKE_OPT := \
+ $(CROSS_ENV_PROGS) \
+ VSNP=0 \
+ SZ64=$(call ptx/ifdef, PTXCONF_ARCH_LP64,1,0) \
+ all-shared
+USTR_INSTALL_OPT := \
+ $(USTR_MAKE_OPT) \
+ install
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/ustr.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, ustr)
+ @$(call install_fixup, ustr,PRIORITY,optional)
+ @$(call install_fixup, ustr,SECTION,base)
+ @$(call install_fixup, ustr,AUTHOR,"Wolfram Sang <w.sang@pengutronix.de>")
+ @$(call install_fixup, ustr,DESCRIPTION,missing)
+
+ @$(call install_lib, ustr, 0, 0, 0644, libustr-1.0)
+
+ @$(call install_finish, ustr)
+
+ @$(call touch)
+
+# vim: syntax=make