diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/ustr/files/autoconf.diff b/sdk_container/src/third_party/coreos-overlay/dev-libs/ustr/files/autoconf.diff new file mode 100644 index 0000000000..7298588f2b --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/ustr/files/autoconf.diff @@ -0,0 +1,1975 @@ +From: Václav Ovsík +Subject: [PATCH] fixes/autoconf + +GNU Autoconf used instead of its own makefile rules driven +configuration. This is more general and flexible and +it supports cross-compilation. + +Signed-off-by: Václav Ovsík + +--- + .gitignore | 12 +- + Makefile | 651 --------------------------------------------- + Makefile.in | 685 ++++++++++++++++++++++++++++++++++++++++++++++++ + aclocal.m4 | 89 +++++++ + autoconf_64b.c | 11 - + autoconf_vsnprintf.c | 177 ------------- + configure.ac | 121 +++++++++ + ustr-conf-debug.h.in | 75 ++++++ + ustr-conf.h.in | 8 +- + ustr-import-multilib.in | 4 +- + ustr-import.in | 9 +- + 11 files changed, 992 insertions(+), 850 deletions(-) + +diff --git a/.gitignore b/.gitignore +index 1ff933f..f4a3159 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,5 +1,8 @@ +-/autoconf_64b +-/autoconf_vsnprintf ++/Makefile ++/autom4te.cache ++/config.log ++/config.status ++/configure + /ctst_* + /octst_* + /tst_* +@@ -9,9 +12,14 @@ + /lib-all.info + /libustr-1.0.so.1.0.* + /libustr-debug-1.0.so.1.0.* ++/libustr.a ++/libustr-debug.a + /ustr-conf-debug.h + /ustr-conf.h + /ustr-import ++/ustr-import-multilib ++/ustr-*-dbg.o ++/ustr-*-opt.o + examples/hello_world + examples/hello_world-s + examples/netstr +diff --git a/Makefile b/Makefile +deleted file mode 100644 +index 7a0f317..0000000 +--- a/Makefile ++++ /dev/null +@@ -1,651 +0,0 @@ +- +-# FIXME: Lots of C&P of VERSION ... +-# ustr*.pc, ustr.spec, Documentation/*.pl, Documentation/ustr-import.1, +-# ./scripts/rpms-create-james.sh +-VERS=1.0 +-VERS_FULL=$(VERS).4 +-VERS_BSO =1.0 +-VERS_ESONAME =1 +-VERS_ESO =$(VERS_ESONAME).0.4 +- +-DESTDIR = +-prefix=/usr +-datadir=$(prefix)/share +-libdir=$(prefix)/lib +-libexecdir=$(prefix)/libexec +-bindir=$(prefix)/bin +-includedir=$(prefix)/include +-SHRDIR=$(datadir)/ustr-$(VERS_FULL) +-DOCSHRDIR=$(datadir)/doc/ustr-devel-$(VERS_FULL) +-EXAMDIR=$(SHRDIR)/examples +-mandir=$(datadir)/doc/man +-MBINDIR=$(libexecdir)/ustr-$(VERS_FULL) +- +-############################################################################### +-# This is here to work around the "Fedora build system requirement" that a big +-# pile of crap ends up in the build.log file even though all sane people don't +-# want that. See rhbz#248231 +-############################################################################### +-HIDE=@ +- +-CC = cc +-AR = ar +-RANLIB = ranlib +-LDCONFIG = /sbin/ldconfig +- +-CFLAGS = -O2 -g +- +-# Debug versions... +-WARNS = -W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security # -Wfloat-equal -- no floats +-# Fedora policies/"reviewers" are completely retarded and refuse to allow +-# lowering the "Fedora build flags" even when it activley hurts their users, +-# this makes it easier for them to hurt you. Welcome to the lowest common +-# denominator collective. +-DBG_ONLY_BAD_POLICIES_HAVE_THIS_EMPTY_CFLAGS=-O1 +-DBG_CFLAGS = $(CFLAGS) $(WARNS) $(DBG_ONLY_BAD_POLICIES_HAVE_THIS_EMPTY_CFLAGS) +- +-# Inline tst_*.c and otst_*.c files. +-CFLG_TST = +- +-CFLG_TST_C = $(CFLG_TST) \ +- -DUSTR_CONF_INCLUDE_CODEONLY_HEADERS=1 -DUSTR_CONF_REF_BYTES=4 +- +-# Optimized o*.c files +-CFLG_TST_O = -DUSTR_DEBUG=0 $(CFLG_TST) +-CFLG_TST_CO = -DUSTR_DEBUG=0 $(CFLG_TST_C) +- +-# fread64/etc. +-CFLG_LIB = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +- +-CFLG_LIB_OPT = $(CFLG_LIB) -DNDEBUG +-CFLG_LIB_DBG = $(CFLG_LIB) +- +-DOCS = README-DEVELOPERS TODO \ +- Documentation/strdup\ vs.\ ustr.gnumeric \ +- Documentation/index.html \ +- Documentation/functions.html \ +- Documentation/constants.html \ +- Documentation/design.html \ +- Documentation/tutorial.html +- +-MAN_PAGES_1 = \ +- Documentation/ustr-import.1 +- +-MAN_PAGES_3 = \ +- Documentation/ustr.3 \ +- Documentation/ustr_const.3 +- +-EXAMPLES = examples/Makefile \ +- examples/basename.c \ +- examples/custr.c \ +- examples/dirname.c \ +- examples/fgrep.c \ +- examples/hello_world.c \ +- examples/hexdump.c \ +- examples/linecat.c \ +- examples/mkdir_p.c \ +- examples/netstr.c \ +- examples/nums.c \ +- examples/txt2html.c +- +-# Some versions of GCC really don't like all the includes with inline stuff. +-# so we allow the library only to be checked. This is _bad_ for a release as +-# it basically means ustr-import usage (without -c) will kill GCC too. +-TST_STATIC_ALL = tst_0_sizes tst_0_manual \ +- otst_0_sizes otst_0_manual \ +- tst_0_nothing \ +- otst_0_nothing \ +- tst_1_basic \ +- otst_1_basic \ +- tst_2_small \ +- otst_2_small \ +- tst_3_medium \ +- otst_3_medium \ +- tst_4_grow \ +- otst_4_grow \ +- tst_5_shrink \ +- otst_5_shrink \ +- tst_6_tiny \ +- otst_6_tiny \ +- tst_7_auto \ +- otst_7_auto \ +- tst_8_spn \ +- otst_8_spn \ +- tst_9_ins \ +- otst_9_ins \ +- tst_10_b \ +- otst_10_b \ +- tst_11_io \ +- otst_11_io \ +- tst_12_fmt \ +- otst_12_fmt \ +- tst_13_utf8 \ +- otst_13_utf8 \ +- tst_14_cmp \ +- otst_14_cmp \ +- tst_15_trim \ +- otst_15_trim \ +- tst_16_parse \ +- otst_16_parse \ +- tst_17_sub \ +- otst_17_sub \ +- tst_18_split \ +- otst_18_split \ +- tst_19_concat \ +- otst_19_concat \ +- tst_19_join \ +- otst_19_join \ +- tst_98_pool \ +- otst_98_pool \ +- tst_99_enomem \ +- otst_99_enomem \ +- tst_99_64bit \ +- otst_99_64bit +- +-TST_ALL = ctst_0_cntl \ +- octst_0_cntl \ +- ctst_0_nothing \ +- octst_0_nothing \ +- ctst_3_medium \ +- octst_3_medium \ +- ctst_4_grow \ +- octst_4_grow \ +- ctst_5_shrink \ +- octst_5_shrink \ +- ctst_7_auto \ +- octst_7_auto \ +- ctst_8_spn \ +- octst_8_spn \ +- ctst_9_ins \ +- octst_9_ins \ +- ctst_10_b \ +- octst_10_b \ +- ctst_11_io \ +- octst_11_io \ +- ctst_12_fmt \ +- octst_12_fmt \ +- ctst_13_utf8 \ +- octst_13_utf8 \ +- ctst_14_cmp \ +- octst_14_cmp \ +- ctst_15_trim \ +- octst_15_trim \ +- ctst_16_parse \ +- octst_16_parse \ +- ctst_17_sub \ +- octst_17_sub \ +- ctst_18_split \ +- octst_18_split \ +- ctst_19_concat \ +- octst_19_concat \ +- ctst_19_join \ +- octst_19_join \ +- ctst_98_pool \ +- octst_98_pool \ +- ctst_99_enomem \ +- octst_99_enomem \ +- ctst_99_64bit \ +- octst_99_64bit \ +- $(TST_STATIC_ALL) +-XFAIL_TESTS = +- +-SRC_HDRS = ustr.h ustr-debug.h \ +- ustr-conf.h ustr-conf-debug.h \ +- ustr-b.h \ +- ustr-cmp.h \ +- ustr-cntl.h \ +- ustr-compiler.h \ +- ustr-fmt.h \ +- ustr-io.h \ +- ustr-ins.h \ +- ustr-main.h \ +- ustr-parse.h \ +- ustr-pool.h \ +- ustr-replace.h \ +- ustr-sc.h \ +- ustr-set.h \ +- ustr-split.h \ +- ustr-spn.h \ +- ustr-srch.h \ +- ustr-sub.h \ +- ustr-utf8.h +- +-SRC_HDRS_MULTI_LIB = \ +- ustr-conf-multilib-linux.h ustr-conf-debug-multilib-linux.h \ +- +-SRC_SRCS_H = malloc-check.h \ +- ustr-b-code.h \ +- ustr-cmp-code.h \ +- ustr-cmp-internal.h \ +- ustr-cntl-code.h \ +- ustr-fmt-code.h \ +- ustr-fmt-internal.h \ +- ustr-io-code.h \ +- ustr-io-internal.h \ +- ustr-ins-code.h \ +- ustr-ins-internal.h \ +- ustr-main-code.h \ +- ustr-main-internal.h \ +- ustr-parse-code.h \ +- ustr-pool-code.h \ +- ustr-replace-code.h \ +- ustr-replace-internal.h \ +- ustr-sc-code.h \ +- ustr-sc-internal.h \ +- ustr-set-code.h \ +- ustr-set-internal.h \ +- ustr-split-code.h \ +- ustr-split-internal.h \ +- ustr-spn-code.h \ +- ustr-srch-code.h \ +- ustr-srch-internal.h \ +- ustr-sub-code.h \ +- ustr-sub-internal.h \ +- ustr-utf8-code.h \ +- ustr-utf8-internal.h +- +-SRC_SRCS_C = ustr-b-dbg-code.c \ +- ustr-cmp-dbg-code.c \ +- ustr-fmt-dbg-code.c \ +- ustr-io-dbg-code.c \ +- ustr-ins-dbg-code.c \ +- ustr-main-dbg-code.c \ +- ustr-parse-dbg-code.c \ +- ustr-pool-dbg-code.c \ +- ustr-replace-dbg-code.c \ +- ustr-sc-dbg-code.c \ +- ustr-set-dbg-code.c \ +- ustr-split-dbg-code.c \ +- ustr-spn-dbg-code.c \ +- ustr-srch-dbg-code.c \ +- ustr-sub-dbg-code.c \ +- ustr-utf8-dbg-code.c \ +- \ +- ustr-b-opt-code.c \ +- ustr-cmp-opt-code.c \ +- ustr-fmt-opt-code.c \ +- ustr-io-opt-code.c \ +- ustr-ins-opt-code.c \ +- ustr-main-opt-code.c \ +- ustr-parse-opt-code.c \ +- ustr-pool-opt-code.c \ +- ustr-replace-opt-code.c \ +- ustr-sc-opt-code.c \ +- ustr-set-opt-code.c \ +- ustr-split-opt-code.c \ +- ustr-spn-opt-code.c \ +- ustr-srch-opt-code.c \ +- ustr-sub-opt-code.c \ +- ustr-utf8-opt-code.c +- +-SRC_SRCS = $(SRC_SRCS_C) $(SRC_SRCS_H) +-XSRC_SRCS = .gdbinit +- +-DBG_LIB_SHAREDEV = libustr-debug.so +-DBG_LIB_SHARED_NAME = libustr-debug-$(VERS_BSO).so.$(VERS_ESONAME) +-DBG_LIB_SHARED = libustr-debug-$(VERS_BSO).so.$(VERS_ESO) +-DBG_LIB_STATIC = libustr-debug.a +- +-OPT_LIB_SHAREDEV = libustr.so +-OPT_LIB_SHARED_NAME = libustr-$(VERS_BSO).so.$(VERS_ESONAME) +-OPT_LIB_SHARED = libustr-$(VERS_BSO).so.$(VERS_ESO) +-OPT_LIB_STATIC = libustr.a +- +-LIB_SHARED = $(DBG_LIB_SHARED) $(OPT_LIB_SHARED) +-LIB_STATIC = $(DBG_LIB_STATIC) $(OPT_LIB_STATIC) +- +-DEPS_NONC_ALL = $(SRC_HDRS) $(SRC_SRCS_H) +-DEPS_C_ALL = $(SRC_HDRS) +-OBJS_C_DBG_ALL = $(DBG_LIB_STATIC) +-OBJS_C_OPT_ALL = $(OPT_LIB_STATIC) +- +-LIB_SHARED_DBG = \ +- ustr-b-code-so-dbg.o \ +- ustr-cmp-code-so-dbg.o \ +- ustr-fmt-code-so-dbg.o \ +- ustr-io-code-so-dbg.o \ +- ustr-ins-code-so-dbg.o \ +- ustr-main-code-so-dbg.o \ +- ustr-parse-code-so-dbg.o \ +- ustr-pool-code-so-dbg.o \ +- ustr-replace-code-so-dbg.o \ +- ustr-sc-code-so-dbg.o \ +- ustr-set-code-so-dbg.o \ +- ustr-split-code-so-dbg.o \ +- ustr-spn-code-so-dbg.o \ +- ustr-srch-code-so-dbg.o \ +- ustr-sub-code-so-dbg.o \ +- ustr-utf8-code-so-dbg.o +-LIB_STATIC_DBG = \ +- ustr-b-code-a-dbg.o \ +- ustr-cmp-code-a-dbg.o \ +- ustr-fmt-code-a-dbg.o \ +- ustr-io-code-a-dbg.o \ +- ustr-ins-code-a-dbg.o \ +- ustr-main-code-a-dbg.o \ +- ustr-parse-code-a-dbg.o \ +- ustr-pool-code-a-dbg.o \ +- ustr-replace-code-a-dbg.o \ +- ustr-sc-code-a-dbg.o \ +- ustr-set-code-a-dbg.o \ +- ustr-split-code-a-dbg.o \ +- ustr-spn-code-a-dbg.o \ +- ustr-srch-code-a-dbg.o \ +- ustr-sub-code-a-dbg.o \ +- ustr-utf8-code-a-dbg.o +- +-LIB_SHARED_OPT = \ +- ustr-b-code-so-opt.o \ +- ustr-cmp-code-so-opt.o \ +- ustr-fmt-code-so-opt.o \ +- ustr-io-code-so-opt.o \ +- ustr-ins-code-so-opt.o \ +- ustr-main-code-so-opt.o \ +- ustr-parse-code-so-opt.o \ +- ustr-pool-code-so-opt.o \ +- ustr-replace-code-so-opt.o \ +- ustr-sc-code-so-opt.o \ +- ustr-set-code-so-opt.o \ +- ustr-split-code-so-opt.o \ +- ustr-spn-code-so-opt.o \ +- ustr-srch-code-so-opt.o \ +- ustr-sub-code-so-opt.o \ +- ustr-utf8-code-so-opt.o +-LIB_STATIC_OPT = \ +- ustr-b-code-a-opt.o \ +- ustr-cmp-code-a-opt.o \ +- ustr-fmt-code-a-opt.o \ +- ustr-io-code-a-opt.o \ +- ustr-ins-code-a-opt.o \ +- ustr-main-code-a-opt.o \ +- ustr-parse-code-a-opt.o \ +- ustr-pool-code-a-opt.o \ +- ustr-replace-code-a-opt.o \ +- ustr-sc-code-a-opt.o \ +- ustr-set-code-a-opt.o \ +- ustr-split-code-a-opt.o \ +- ustr-spn-code-a-opt.o \ +- ustr-srch-code-a-opt.o \ +- ustr-sub-code-a-opt.o \ +- ustr-utf8-code-a-opt.o +- +- +-all: ustr-import $(LIB_STATIC) +- $(HIDE)echo Done static +- +-all-shared: all $(LIB_SHARED) +- $(HIDE)echo Done shared +- +-install: all-shared ustr.pc ustr-debug.pc +- $(HIDE)echo Making directories +- install -d $(DESTDIR)$(libdir) +- install -d $(DESTDIR)$(includedir) +- install -d $(DESTDIR)$(SHRDIR) +- install -d $(DESTDIR)$(DOCSHRDIR) +- install -d $(DESTDIR)$(EXAMDIR) +- install -d $(DESTDIR)$(mandir)/man1 +- install -d $(DESTDIR)$(mandir)/man3 +- install -d $(DESTDIR)$(bindir) +- install -d $(DESTDIR)$(libdir)/pkgconfig +- $(HIDE)echo Installing files +- install -m 644 -t $(DESTDIR)$(libdir) $(LIB_STATIC) +- install -m 755 -t $(DESTDIR)$(libdir) $(LIB_SHARED) +- -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME) +- ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME) +- -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV) +- ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV) +- -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME) +- ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME) +- -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV) +- ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV) +- $(LDCONFIG) -n $(DESTDIR)$(libdir) +- install -pm 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS) +- install -pm 644 -t $(DESTDIR)$(SHRDIR) $(SRC_SRCS) +- install -pm 644 -t $(DESTDIR)$(SHRDIR) $(XSRC_SRCS) +- install -pm 644 -t $(DESTDIR)$(DOCSHRDIR) $(DOCS) +- install -pm 644 -t $(DESTDIR)$(EXAMDIR) $(EXAMPLES) +- install -pm 644 -t $(DESTDIR)$(mandir)/man1 $(MAN_PAGES_1) +- install -pm 644 -t $(DESTDIR)$(mandir)/man3 $(MAN_PAGES_3) +- install -m 755 -t $(DESTDIR)$(bindir) ustr-import +- install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc ustr-debug.pc +- +-ustr-import-multilib: ustr-import-multilib.in +- sed -e 's,@INCLUDEDIR@,$(includedir),g' -e 's,@MBINDIR@,$(MBINDIR),g' < $< > $@ +- +-install-multilib-linux: install autoconf_64b ustr-import-multilib +- install -d $(DESTDIR)$(MBINDIR) +- $(HIDE)mlib=`./autoconf_64b`; \ +- if test "x$$mlib" = "x1"; then mlib=64; else mlib=32; fi; \ +- mv -f $(DESTDIR)$(includedir)/ustr-conf-debug.h \ +- $(DESTDIR)$(includedir)/ustr-conf-debug-$$mlib.h; \ +- mv -f $(DESTDIR)$(includedir)/ustr-conf.h \ +- $(DESTDIR)$(includedir)/ustr-conf-$$mlib.h; \ +- mv -f $(DESTDIR)$(bindir)/ustr-import \ +- $(DESTDIR)$(MBINDIR)/ustr-import-$$mlib +- install -m 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS_MULTI_LIB) +- $(HIDE)mv -f $(DESTDIR)$(includedir)/ustr-conf-debug-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf-debug.h +- $(HIDE)mv -f $(DESTDIR)$(includedir)/ustr-conf-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf.h +- install -m 755 -t $(DESTDIR)$(bindir) ustr-import-multilib +- $(HIDE)mv -f $(DESTDIR)$(bindir)/ustr-import-multilib $(DESTDIR)$(bindir)/ustr-import +- $(HIDE)touch --reference ustr-conf-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf.h +- $(HIDE)touch --reference ustr-conf-debug-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf-debug.h +- $(HIDE)touch --reference ustr-import-multilib.in $(DESTDIR)$(bindir)/ustr-import +- +- +-clean: +- $(HIDE)echo Cleanup +- $(HIDE)rm -f $(LIB_SHARED) $(LIB_STATIC) +- $(HIDE)rm -f $(TST_ALL) +- $(HIDE)rm -f *.o +- $(HIDE)rm -f perf-sizes perf-sizes32 perf-sizes64 +- $(HIDE)rm -f *.gcda *.gcno *.gcov +- $(HIDE)rm -f tst_*.c ctst_*.c otst_*.c octst_*.c +- $(HIDE)rm -f ustr-import-multilib +- +-distclean: clean +- rm -f ustr-import +- rm -f autoconf_64b autoconf_vsnprintf +- rm -f ustr-conf.h ustr-conf-debug.h +- rm -rf lcov-output +- +- +-ustr-import: ustr-import.in autoconf_64b autoconf_vsnprintf +- $(HIDE)echo Creating $@ +- $(HIDE)sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \ +- sed -e 's,@INCLUDEDIR@,$(includedir),g' -e 's,@SHRDIR@,$(SHRDIR),g' -e 's,@VERS@,$(VERS),g' -e 's,@VERS_FULL@,$(VERS_FULL),g' -e "s,@HAVE_64bit_SIZE_MAX@,$$sz64,g" -e "s,@HAVE_RETARDED_VSNPRINTF@,$$vsnp,g" < $< > $@ +- $(HIDE)chmod 755 $@ +- +-# Use CFLAGS so that CFLAGS="... -m32" does the right thing +-autoconf_64b: autoconf_64b.c +- $(HIDE)echo Compiling: auto configuration test: 64bit +- $(HIDE)$(CC) $(CFLAGS) -o $@ $< +- +-autoconf_vsnprintf: autoconf_vsnprintf.c +- $(HIDE)echo Compiling: auto configuration test: vsnprintf +- $(HIDE)$(CC) -o $@ $< +- +-# Use LDFLAGS for LDFLAGS="-m32" +-$(OPT_LIB_SHARED): $(LIB_SHARED_OPT) +- $(HIDE)echo Linking SO OPT lib: $@ +- $(HIDE)$(CC) -shared $^ -Wl,-soname -Wl,$(OPT_LIB_SHARED_NAME) -Wl,-version-script -Wl,libustr.ver $(LDFLAGS) -o $@ +- +-$(DBG_LIB_SHARED): $(LIB_SHARED_DBG) +- $(HIDE)echo Linking SO DBG lib: $@ +- $(HIDE)$(CC) -shared $^ -Wl,-soname -Wl,$(DBG_LIB_SHARED_NAME) -Wl,-version-script -Wl,libustr.ver $(LDFLAGS) -o $@ +- +-libustr.a: $(LIB_STATIC_OPT) +- $(HIDE)echo Linking A OPT lib: $@ +- $(HIDE)$(AR) ru $@ $^ +- $(HIDE)$(RANLIB) $@ +-libustr-debug.a: $(LIB_STATIC_DBG) +- $(HIDE)echo Linking A DBG lib: $@ +- $(HIDE)$(AR) ru $@ $^ +- $(HIDE)$(RANLIB) $@ +- +-ustr-conf.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf +- $(HIDE)echo Creating $@ +- $(HIDE)have_stdint_h=0; 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; \ +- if test -f "$(includedir)/stdint.h"; then have_stdint_h=1; fi; \ +- sed -e "s,@HAVE_STDINT_H@,$$have_stdint_h,g" -e "s,@USE_ASSERT@,$$dbg1,g" -e "s,@USE_EOS_MARK@,$$dbg2,g" -e "s,@HAVE_64bit_SIZE_MAX@,$$sz64,g" -e "s,@HAVE_RETARDED_VSNPRINTF@,$$vsnp,g" < $< > $@ +- +-ustr-conf-debug.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf +- $(HIDE)echo Creating $@ +- $(HIDE)have_stdint_h=0; 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; \ +- if test -f "$(includedir)/stdint.h"; then have_stdint_h=1; fi; \ +- sed -e "s,@HAVE_STDINT_H@,$$have_stdint_h,g" -e "s,@USE_ASSERT@,$$dbg1,g" -e "s,@USE_EOS_MARK@,$$dbg2,g" -e "s,@HAVE_64bit_SIZE_MAX@,$$sz64,g" -e "s,@HAVE_RETARDED_VSNPRINTF@,$$vsnp,g" < $< > $@ +- +- +-# We don't use $(DEPS_NONC_ALL) as deps. because it then recompiles everything +-# too much, and we care about speed more. Do make clean to "fix". +-# Yes, scons fixes this. +-%-code-so-opt.o: %-opt-code.c %-code.h %.h $(DEPS_C_ALL) +- $(HIDE)echo Compiling for SO OPT lib: $< +- $(HIDE)$(CC) $(CFLAGS) -fPIC $(CFLG_LIB_OPT) -o $@ -c $< +- +-%-code-so-dbg.o: %-dbg-code.c %-code.h %.h $(DEPS_C_ALL) +- $(HIDE)echo Compiling for SO DBG lib: $< +- $(HIDE)$(CC) $(DBG_CFLAGS) -fPIC $(CFLG_LIB_DBG) -o $@ -c $< +- +-%-code-a-opt.o: %-opt-code.c %-code.h %.h $(DEPS_C_ALL) +- $(HIDE)echo Compiling for A OPT lib: $< +- $(HIDE)$(CC) $(CFLAGS) $(CFLG_LIB_OPT) -o $@ -c $< +- +-%-code-a-dbg.o: %-dbg-code.c %-code.h %.h $(DEPS_C_ALL) +- $(HIDE)echo Compiling for A DBG lib: $< +- $(HIDE)$(CC) $(DBG_CFLAGS) $(CFLG_LIB_DBG) -o $@ -c $< +- +- +-perf-sizes: perf-sizes.c $(OBJS_C_OPT_ALL) +- $(CC) $(WARNS) -O2 -g $(LDFLAGS) -o $@ $^ +- +-perf-sizes32: perf-sizes.c $(OBJS_C_OPT_ALL) +- $(CC) $(WARNS) -O2 -g $(LDFLAGS) -m32 -o $@ $^ +- +-perf-sizes64: perf-sizes.c $(OBJS_C_OPT_ALL) +- $(CC) $(WARNS) -O2 -g $(LDFLAGS) -m64 -o $@ $^ +- +-# We "generate" the test files ... because "make clean" then makes the +-# dir. readble. And it helps coverage testing. +-tst_%.c: T/tst_%.c T/ctst_%.c +- $(HIDE)cat $^ > $@ +-otst_%.c: T/tst_%.c T/ctst_%.c +- $(HIDE)cat $^ > $@ +-ctst_%.c: T/ctst_%.c +- $(HIDE)cat $< > $@ +-octst_%.c: T/ctst_%.c +- $(HIDE)cat $< > $@ +- +-# Debugging tst and "compiled" tst (links with libustr-debug) +-tst_%.o: tst_%.c tst.h $(DEPS_NONC_ALL) +- $(HIDE)echo "Compiling: " $@ +- $(HIDE)$(CC) $(DBG_CFLAGS) $(CFLG_TST_C) -o $@ -c $< +- +-tst_%: tst_%.o +- $(HIDE)$(CC) $(LDFLAGS) -o $@ $< +- +-ctst_%.o: ctst_%.c tst.h $(DEPS_C_ALL) +- $(HIDE)echo "Compiling: " $@ +- $(HIDE)$(CC) $(DBG_CFLAGS) $(CFLG_TST) -o $@ -c $< +- +-ctst_%: ctst_%.o $(OBJS_C_DBG_ALL) +- $(HIDE)$(CC) $(LDFLAGS) -o $@ $^ +- +-# Optimized tst and "compiled" tst (links with libustr) +-otst_%.o: otst_%.c tst.h $(DEPS_NONC_ALL) +- $(HIDE)echo "Compiling: " $@ +- $(HIDE)$(CC) $(CFLAGS) $(CFLG_TST_CO) -o $@ -c $< +- +-otst_%: otst_%.o +- $(HIDE)$(CC) $(LDFLAGS) -o $@ $< +- +-octst_%.o: octst_%.c tst.h $(DEPS_C_ALL) +- $(HIDE)echo "Compiling:" $@ +- $(HIDE)$(CC) $(CFLAGS) $(CFLG_TST_O) -o $@ -c $< +- +-octst_%: octst_%.o $(OBJS_C_OPT_ALL) +- $(HIDE)$(CC) $(LDFLAGS) -o $@ $^ +- +- +-check-lcov: check ./scripts/lcov.sh +- ./scripts/lcov.sh +- +-# -------------------------------- +-# Borrowed from automake output... +-# -------------------------------- +-PACKAGE_BUGREPORT = "james@and.org" +-check: $(DBG_LIB_STATIC) $(TST_ALL) +- $(HIDE)failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ +- list=' $(TST_ALL) '; \ +- if test -n "$$list"; then \ +- for tst in $$list; do \ +- if ./$$tst; then \ +- all=`expr $$all + 1`; \ +- case " $(XFAIL_TESTS) " in \ +- *$$ws$$tst$$ws*) \ +- xpass=`expr $$xpass + 1`; \ +- failed=`expr $$failed + 1`; \ +- echo "XPASS: $$tst"; \ +- ;; \ +- *) \ +- echo "PASS: $$tst"; \ +- ;; \ +- esac; \ +- elif test $$? -ne 77; then \ +- all=`expr $$all + 1`; \ +- case " $(XFAIL_TESTS) " in \ +- *$$ws$$tst$$ws*) \ +- xfail=`expr $$xfail + 1`; \ +- echo "XFAIL: $$tst"; \ +- ;; \ +- *) \ +- failed=`expr $$failed + 1`; \ +- echo "FAIL: $$tst"; \ +- ;; \ +- esac; \ +- else \ +- skip=`expr $$skip + 1`; \ +- echo "SKIP: $$tst"; \ +- fi; \ +- done; \ +- if test "$$failed" -eq 0; then \ +- if test "$$xfail" -eq 0; then \ +- banner="All $$all tests passed"; \ +- else \ +- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ +- fi; \ +- else \ +- if test "$$xpass" -eq 0; then \ +- banner="$$failed of $$all tests failed"; \ +- else \ +- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ +- fi; \ +- fi; \ +- dashes="$$banner"; \ +- skipped=""; \ +- if test "$$skip" -ne 0; then \ +- skipped="($$skip tests were not run)"; \ +- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ +- dashes="$$skipped"; \ +- fi; \ +- report=""; \ +- if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ +- report="Please report to $(PACKAGE_BUGREPORT)"; \ +- test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ +- dashes="$$report"; \ +- fi; \ +- dashes=`echo "$$dashes" | sed s/./=/g`; \ +- echo "$$dashes"; \ +- echo "$$banner"; \ +- test -z "$$skipped" || echo "$$skipped"; \ +- test -z "$$report" || echo "$$report"; \ +- echo "$$dashes"; \ +- test "$$failed" -eq 0; \ +- else :; fi +- +- +diff --git a/Makefile.in b/Makefile.in +new file mode 100644 +index 0000000..78357bb +--- /dev/null ++++ b/Makefile.in +@@ -0,0 +1,685 @@ ++AR = @AR@ ++CC = @CC@ ++CFLAGS = @CFLAGS@ ++CPPFLAGS = @CPPFLAGS@ ++DBG_CFLAGS_OPT = @DBG_CFLAGS_OPT@ ++HAVE_64bit_SIZE_MAX = @HAVE_64bit_SIZE_MAX@ ++HAVE_STDINT_H = @HAVE_STDINT_H@ ++LDFLAGS = @LDFLAGS@ ++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ ++PACKAGE_NAME = @PACKAGE_NAME@ ++PACKAGE_STRING = @PACKAGE_STRING@ ++PACKAGE_TARNAME = @PACKAGE_TARNAME@ ++PACKAGE_URL = @PACKAGE_URL@ ++PACKAGE_VERSION = @PACKAGE_VERSION@ ++RANLIB = @RANLIB@ ++SHELL = @SHELL@ ++bindir = @bindir@ ++datarootdir = @datarootdir@ ++datadir = @datadir@ ++exec_prefix = @exec_prefix@ ++includedir = @includedir@ ++includedir_arch = ${includedir} ++libdir = @libdir@ ++libexecdir = @libexecdir@ ++mandir = @mandir@ ++prefix = @prefix@ ++ ++# FIXME: Lots of C&P of VERSION ... ++# ustr*.pc, ustr.spec, Documentation/*.pl, Documentation/ustr-import.1, ++# ./scripts/rpms-create-james.sh ++version_major=@version_major@ ++version_minor=@version_minor@ ++version_release=@version_release@ ++VERS_BSO =${version_major}.${version_minor} ++VERS_ESONAME =${version_major} ++VERS_ESO =${version_major}.${version_minor}.${version_release} ++SHRDIR=@SHRDIR@ ++DOCSHRDIR=@DOCSHRDIR@ ++EXAMDIR=@EXAMDIR@ ++MBINDIR=@MBINDIR@ ++LDCONFIG=@LDCONFIG@ ++ ++ifeq ($(HAVE_64bit_SIZE_MAX),1) ++ mlib=64 ++else ++ mlib=32 ++endif ++ ++# Want you hide compile commands really? Override it on command-line... ++#HIDE=@ ++# Debug versions... ++WARNS = -W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security # -Wfloat-equal -- no floats ++# Fedora policies/"reviewers" are completely retarded and refuse to allow ++# lowering the "Fedora build flags" even when it activley hurts their users, ++# this makes it easier for them to hurt you. Welcome to the lowest common ++# denominator collective. ++DBG_ONLY_BAD_POLICIES_HAVE_THIS_EMPTY_CFLAGS=$(DBG_CFLAGS_OPT) ++DBG_CFLAGS = $(CFLAGS) $(WARNS) $(DBG_ONLY_BAD_POLICIES_HAVE_THIS_EMPTY_CFLAGS) ++ ++# Inline tst_*.c and otst_*.c files. ++CFLG_TST = ++ ++CFLG_TST_C = $(CFLG_TST) \ ++ -DUSTR_CONF_INCLUDE_CODEONLY_HEADERS=1 -DUSTR_CONF_REF_BYTES=4 ++ ++# Optimized o*.c files ++CFLG_TST_O = -DUSTR_DEBUG=0 $(CFLG_TST) ++CFLG_TST_CO = -DUSTR_DEBUG=0 $(CFLG_TST_C) ++ ++# fread64/etc. ++CFLG_LIB = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ++ ++CFLG_LIB_OPT = $(CFLG_LIB) -DNDEBUG ++CFLG_LIB_DBG = $(CFLG_LIB) ++ ++DOCS = README-DEVELOPERS TODO \ ++ Documentation/strdup\ vs.\ ustr.gnumeric \ ++ ++DOCSHTML = Documentation/index.html \ ++ Documentation/functions.html \ ++ Documentation/constants.html \ ++ Documentation/design.html \ ++ Documentation/tutorial.html ++ ++MAN_PAGES_1 = \ ++ Documentation/ustr-import.1 ++ ++MAN_PAGES_3 = \ ++ Documentation/ustr.3 \ ++ Documentation/ustr_const.3 ++ ++EXAMPLES = examples/Makefile \ ++ examples/basename.c \ ++ examples/custr.c \ ++ examples/dirname.c \ ++ examples/fgrep.c \ ++ examples/hello_world.c \ ++ examples/hexdump.c \ ++ examples/linecat.c \ ++ examples/mkdir_p.c \ ++ examples/netstr.c \ ++ examples/nums.c \ ++ examples/txt2html.c ++ ++# Some versions of GCC really don't like all the includes with inline stuff. ++# so we allow the library only to be checked. This is _bad_ for a release as ++# it basically means ustr-import usage (without -c) will kill GCC too. ++TST_STATIC_ALL = tst_0_sizes tst_0_manual \ ++ otst_0_sizes otst_0_manual \ ++ tst_0_nothing \ ++ otst_0_nothing \ ++ tst_1_basic \ ++ otst_1_basic \ ++ tst_2_small \ ++ otst_2_small \ ++ tst_3_medium \ ++ otst_3_medium \ ++ tst_4_grow \ ++ otst_4_grow \ ++ tst_5_shrink \ ++ otst_5_shrink \ ++ tst_6_tiny \ ++ otst_6_tiny \ ++ tst_7_auto \ ++ otst_7_auto \ ++ tst_8_spn \ ++ otst_8_spn \ ++ tst_9_ins \ ++ otst_9_ins \ ++ tst_10_b \ ++ otst_10_b \ ++ tst_11_io \ ++ otst_11_io \ ++ tst_12_fmt \ ++ otst_12_fmt \ ++ tst_13_utf8 \ ++ otst_13_utf8 \ ++ tst_14_cmp \ ++ otst_14_cmp \ ++ tst_15_trim \ ++ otst_15_trim \ ++ tst_16_parse \ ++ otst_16_parse \ ++ tst_17_sub \ ++ otst_17_sub \ ++ tst_18_split \ ++ otst_18_split \ ++ tst_19_concat \ ++ otst_19_concat \ ++ tst_19_join \ ++ otst_19_join \ ++ tst_98_pool \ ++ otst_98_pool \ ++ tst_99_enomem \ ++ otst_99_enomem \ ++ tst_99_64bit \ ++ otst_99_64bit ++ ++TST_ALL = ctst_0_cntl \ ++ octst_0_cntl \ ++ ctst_0_nothing \ ++ octst_0_nothing \ ++ ctst_3_medium \ ++ octst_3_medium \ ++ ctst_4_grow \ ++ octst_4_grow \ ++ ctst_5_shrink \ ++ octst_5_shrink \ ++ ctst_7_auto \ ++ octst_7_auto \ ++ ctst_8_spn \ ++ octst_8_spn \ ++ ctst_9_ins \ ++ octst_9_ins \ ++ ctst_10_b \ ++ octst_10_b \ ++ ctst_11_io \ ++ octst_11_io \ ++ ctst_12_fmt \ ++ octst_12_fmt \ ++ ctst_13_utf8 \ ++ octst_13_utf8 \ ++ ctst_14_cmp \ ++ octst_14_cmp \ ++ ctst_15_trim \ ++ octst_15_trim \ ++ ctst_16_parse \ ++ octst_16_parse \ ++ ctst_17_sub \ ++ octst_17_sub \ ++ ctst_18_split \ ++ octst_18_split \ ++ ctst_19_concat \ ++ octst_19_concat \ ++ ctst_19_join \ ++ octst_19_join \ ++ ctst_98_pool \ ++ octst_98_pool \ ++ ctst_99_enomem \ ++ octst_99_enomem \ ++ ctst_99_64bit \ ++ octst_99_64bit \ ++ $(TST_STATIC_ALL) ++XFAIL_TESTS = ++ ++SRC_HDRS = ustr.h ustr-debug.h \ ++ ustr-b.h \ ++ ustr-cmp.h \ ++ ustr-cntl.h \ ++ ustr-compiler.h \ ++ ustr-fmt.h \ ++ ustr-io.h \ ++ ustr-ins.h \ ++ ustr-main.h \ ++ ustr-parse.h \ ++ ustr-pool.h \ ++ ustr-replace.h \ ++ ustr-sc.h \ ++ ustr-set.h \ ++ ustr-split.h \ ++ ustr-spn.h \ ++ ustr-srch.h \ ++ ustr-sub.h \ ++ ustr-utf8.h ++ ++SRC_HDRS_ARCH = ustr-conf.h ustr-conf-debug.h ++ ++SRC_HDRS_MULTI_LIB = \ ++ ustr-conf-multilib-linux.h ustr-conf-debug-multilib-linux.h \ ++ ++SRC_SRCS_H = malloc-check.h \ ++ ustr-b-code.h \ ++ ustr-cmp-code.h \ ++ ustr-cmp-internal.h \ ++ ustr-cntl-code.h \ ++ ustr-fmt-code.h \ ++ ustr-fmt-internal.h \ ++ ustr-io-code.h \ ++ ustr-io-internal.h \ ++ ustr-ins-code.h \ ++ ustr-ins-internal.h \ ++ ustr-main-code.h \ ++ ustr-main-internal.h \ ++ ustr-parse-code.h \ ++ ustr-pool-code.h \ ++ ustr-replace-code.h \ ++ ustr-replace-internal.h \ ++ ustr-sc-code.h \ ++ ustr-sc-internal.h \ ++ ustr-set-code.h \ ++ ustr-set-internal.h \ ++ ustr-split-code.h \ ++ ustr-split-internal.h \ ++ ustr-spn-code.h \ ++ ustr-srch-code.h \ ++ ustr-srch-internal.h \ ++ ustr-sub-code.h \ ++ ustr-sub-internal.h \ ++ ustr-utf8-code.h \ ++ ustr-utf8-internal.h ++ ++SRC_SRCS_C = ustr-b-dbg-code.c \ ++ ustr-cmp-dbg-code.c \ ++ ustr-fmt-dbg-code.c \ ++ ustr-io-dbg-code.c \ ++ ustr-ins-dbg-code.c \ ++ ustr-main-dbg-code.c \ ++ ustr-parse-dbg-code.c \ ++ ustr-pool-dbg-code.c \ ++ ustr-replace-dbg-code.c \ ++ ustr-sc-dbg-code.c \ ++ ustr-set-dbg-code.c \ ++ ustr-split-dbg-code.c \ ++ ustr-spn-dbg-code.c \ ++ ustr-srch-dbg-code.c \ ++ ustr-sub-dbg-code.c \ ++ ustr-utf8-dbg-code.c \ ++ \ ++ ustr-b-opt-code.c \ ++ ustr-cmp-opt-code.c \ ++ ustr-fmt-opt-code.c \ ++ ustr-io-opt-code.c \ ++ ustr-ins-opt-code.c \ ++ ustr-main-opt-code.c \ ++ ustr-parse-opt-code.c \ ++ ustr-pool-opt-code.c \ ++ ustr-replace-opt-code.c \ ++ ustr-sc-opt-code.c \ ++ ustr-set-opt-code.c \ ++ ustr-split-opt-code.c \ ++ ustr-spn-opt-code.c \ ++ ustr-srch-opt-code.c \ ++ ustr-sub-opt-code.c \ ++ ustr-utf8-opt-code.c ++ ++SRC_SRCS = $(SRC_SRCS_C) $(SRC_SRCS_H) ++XSRC_SRCS = .gdbinit ++ ++DBG_LIB_SHAREDEV = libustr-debug.so ++DBG_LIB_SHAREDEV_BSO = libustr-debug-$(VERS_BSO).so ++DBG_LIB_SHARED_NAME = libustr-debug-$(VERS_BSO).so.$(VERS_ESONAME) ++DBG_LIB_SHARED = libustr-debug-$(VERS_BSO).so.$(VERS_ESO) ++DBG_LIB_STATIC = libustr-debug.a ++ ++OPT_LIB_SHAREDEV = libustr.so ++OPT_LIB_SHAREDEV_BSO = libustr-$(VERS_BSO).so ++OPT_LIB_SHARED_NAME = libustr-$(VERS_BSO).so.$(VERS_ESONAME) ++OPT_LIB_SHARED = libustr-$(VERS_BSO).so.$(VERS_ESO) ++OPT_LIB_STATIC = libustr.a ++ ++LIB_SHARED = $(DBG_LIB_SHARED) $(OPT_LIB_SHARED) ++LIB_STATIC = $(DBG_LIB_STATIC) $(OPT_LIB_STATIC) ++ ++DEPS_NONC_ALL = $(SRC_HDRS) $(SRC_HDRS_ARCH) $(SRC_SRCS_H) ++DEPS_C_ALL = $(SRC_HDRS) $(SRC_HDRS_ARCH) ++OBJS_C_DBG_ALL = $(DBG_LIB_STATIC) ++OBJS_C_OPT_ALL = $(OPT_LIB_STATIC) ++ ++LIB_SHARED_DBG = \ ++ ustr-b-code-so-dbg.o \ ++ ustr-cmp-code-so-dbg.o \ ++ ustr-fmt-code-so-dbg.o \ ++ ustr-io-code-so-dbg.o \ ++ ustr-ins-code-so-dbg.o \ ++ ustr-main-code-so-dbg.o \ ++ ustr-parse-code-so-dbg.o \ ++ ustr-pool-code-so-dbg.o \ ++ ustr-replace-code-so-dbg.o \ ++ ustr-sc-code-so-dbg.o \ ++ ustr-set-code-so-dbg.o \ ++ ustr-split-code-so-dbg.o \ ++ ustr-spn-code-so-dbg.o \ ++ ustr-srch-code-so-dbg.o \ ++ ustr-sub-code-so-dbg.o \ ++ ustr-utf8-code-so-dbg.o ++LIB_STATIC_DBG = \ ++ ustr-b-code-a-dbg.o \ ++ ustr-cmp-code-a-dbg.o \ ++ ustr-fmt-code-a-dbg.o \ ++ ustr-io-code-a-dbg.o \ ++ ustr-ins-code-a-dbg.o \ ++ ustr-main-code-a-dbg.o \ ++ ustr-parse-code-a-dbg.o \ ++ ustr-pool-code-a-dbg.o \ ++ ustr-replace-code-a-dbg.o \ ++ ustr-sc-code-a-dbg.o \ ++ ustr-set-code-a-dbg.o \ ++ ustr-split-code-a-dbg.o \ ++ ustr-spn-code-a-dbg.o \ ++ ustr-srch-code-a-dbg.o \ ++ ustr-sub-code-a-dbg.o \ ++ ustr-utf8-code-a-dbg.o ++ ++LIB_SHARED_OPT = \ ++ ustr-b-code-so-opt.o \ ++ ustr-cmp-code-so-opt.o \ ++ ustr-fmt-code-so-opt.o \ ++ ustr-io-code-so-opt.o \ ++ ustr-ins-code-so-opt.o \ ++ ustr-main-code-so-opt.o \ ++ ustr-parse-code-so-opt.o \ ++ ustr-pool-code-so-opt.o \ ++ ustr-replace-code-so-opt.o \ ++ ustr-sc-code-so-opt.o \ ++ ustr-set-code-so-opt.o \ ++ ustr-split-code-so-opt.o \ ++ ustr-spn-code-so-opt.o \ ++ ustr-srch-code-so-opt.o \ ++ ustr-sub-code-so-opt.o \ ++ ustr-utf8-code-so-opt.o ++LIB_STATIC_OPT = \ ++ ustr-b-code-a-opt.o \ ++ ustr-cmp-code-a-opt.o \ ++ ustr-fmt-code-a-opt.o \ ++ ustr-io-code-a-opt.o \ ++ ustr-ins-code-a-opt.o \ ++ ustr-main-code-a-opt.o \ ++ ustr-parse-code-a-opt.o \ ++ ustr-pool-code-a-opt.o \ ++ ustr-replace-code-a-opt.o \ ++ ustr-sc-code-a-opt.o \ ++ ustr-set-code-a-opt.o \ ++ ustr-split-code-a-opt.o \ ++ ustr-spn-code-a-opt.o \ ++ ustr-srch-code-a-opt.o \ ++ ustr-sub-code-a-opt.o \ ++ ustr-utf8-code-a-opt.o ++ ++ ++all: ustr-import $(LIB_STATIC) ++ @echo Done static ++ ++all-shared: all $(LIB_SHARED) ++ @echo Done shared ++ ++all-opt: $(OPT_LIB_STATIC) $(OPT_LIB_SHARED) ++ @echo Done all opt ++ ++all-dbg: $(DBG_LIB_STATIC) $(DBG_LIB_SHARED) ++ @echo Done all dbg ++ ++install: install-opt install-dbg ++ ++install-opt: install-dirs install-opt-lib install-common ++ ++install-dbg: install-dirs install-dbg-lib install-common ++ ++install-opt-lib install-dbg-lib install-common: install-dirs ++ ++install-dirs: ++ @echo Making directories ++ install -d $(DESTDIR)$(libdir) ++ install -d $(DESTDIR)$(includedir) ++ install -d $(DESTDIR)$(includedir_arch) ++ install -d $(DESTDIR)$(SHRDIR) ++ install -d $(DESTDIR)$(DOCSHRDIR) ++ install -d $(DESTDIR)$(DOCSHRDIR)/html ++ install -d $(DESTDIR)$(EXAMDIR) ++ install -d $(DESTDIR)$(mandir)/man1 ++ install -d $(DESTDIR)$(mandir)/man3 ++ install -d $(DESTDIR)$(bindir) ++ install -d $(DESTDIR)$(libdir)/pkgconfig ++ ++install-opt-lib: $(OPT_LIB_STATIC) $(OPT_LIB_SHARED) ustr.pc ++ @echo Installing files ++ install -m 644 -t $(DESTDIR)$(libdir) $(OPT_LIB_STATIC) ++ install -m 755 -t $(DESTDIR)$(libdir) $(OPT_LIB_SHARED) ++ -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME) ++ ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME) ++ -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV) ++ ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV) ++ -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO) ++ ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO) ++ $(LDCONFIG) -n $(DESTDIR)$(libdir) ++ install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc ++ ++install-dbg-lib: $(DBG_LIB_STATIC) $(DBG_LIB_SHARED) ustr-debug.pc ++ @echo Installing files ++ install -m 644 -t $(DESTDIR)$(libdir) $(DBG_LIB_STATIC) ++ install -m 755 -t $(DESTDIR)$(libdir) $(DBG_LIB_SHARED) ++ -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME) ++ ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME) ++ -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV) ++ ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV) ++ -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO) ++ ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO) ++ $(LDCONFIG) -n $(DESTDIR)$(libdir) ++ install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr-debug.pc ++ ++install-common: ++ install -pm 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS) ++ install -pm 644 -t $(DESTDIR)$(includedir_arch) $(SRC_HDRS_ARCH) ++ install -pm 644 -t $(DESTDIR)$(SHRDIR) $(SRC_SRCS) ++ install -pm 644 -t $(DESTDIR)$(SHRDIR) $(XSRC_SRCS) ++ install -pm 644 -t $(DESTDIR)$(DOCSHRDIR) $(DOCS) ++ install -pm 644 -t $(DESTDIR)$(DOCSHRDIR)/html $(DOCSHTML) ++ install -pm 644 -t $(DESTDIR)$(EXAMDIR) $(EXAMPLES) ++ install -pm 644 -t $(DESTDIR)$(mandir)/man1 $(MAN_PAGES_1) ++ install -pm 644 -t $(DESTDIR)$(mandir)/man3 $(MAN_PAGES_3) ++ install -m 755 ustr-import $(DESTDIR)$(bindir)/$(bin_arch_prefix)ustr-import ++ ++ustr-import-multilib: ustr-import-multilib.in config.status ++ ./config.status ++ ++install-multilib-linux: install ustr-import-multilib ++ install -d $(DESTDIR)$(MBINDIR) ++ $(HIDE)mv -f $(DESTDIR)$(includedir)/ustr-conf-debug.h \ ++ $(DESTDIR)$(includedir)/ustr-conf-debug-$(mlib).h ++ $(HIDE)mv -f $(DESTDIR)$(includedir)/ustr-conf.h \ ++ $(DESTDIR)$(includedir)/ustr-conf-$(mlib).h ++ $(HIDE)mv -f $(DESTDIR)$(bindir)/ustr-import \ ++ $(DESTDIR)$(MBINDIR)/ustr-import-$(mlib) ++ install -m 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS_MULTI_LIB) ++ $(HIDE)mv -f $(DESTDIR)$(includedir)/ustr-conf-debug-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf-debug.h ++ $(HIDE)mv -f $(DESTDIR)$(includedir)/ustr-conf-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf.h ++ install -m 755 -t $(DESTDIR)$(bindir) ustr-import-multilib ++ $(HIDE)mv -f $(DESTDIR)$(bindir)/ustr-import-multilib $(DESTDIR)$(bindir)/ustr-import ++ $(HIDE)touch --reference ustr-conf-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf.h ++ $(HIDE)touch --reference ustr-conf-debug-multilib-linux.h $(DESTDIR)$(includedir)/ustr-conf-debug.h ++ $(HIDE)touch --reference ustr-import-multilib.in $(DESTDIR)$(bindir)/ustr-import ++ ++ ++clean: ++ @echo Cleanup ++ $(HIDE)rm -f $(LIB_SHARED) $(LIB_STATIC) ++ $(HIDE)rm -f $(TST_ALL) ++ $(HIDE)rm -f *.o ++ $(HIDE)rm -f perf-sizes perf-sizes32 perf-sizes64 ++ $(HIDE)rm -f *.gcda *.gcno *.gcov ++ $(HIDE)rm -f tst_*.c ctst_*.c otst_*.c octst_*.c ++ $(HIDE)rm -f ustr-import-multilib ++ ++distclean: clean ++ rm -f ustr-import ustr-import-multilib ++ rm -f ustr-conf.h ustr-conf-debug.h ++ rm -rf lcov-output ++ rm -f config.status config.log ++ ++maintainer-clean: distclean ++ rm -rf autom4te.cache ++ rm -f Makefile ++ ++ ++ustr-import: ustr-import.in config.status ++ ./config.status ++ ++# Use LDFLAGS for LDFLAGS="-m32" ++$(OPT_LIB_SHARED): $(LIB_SHARED_OPT) ++ $(if $(HIDE), @echo Linking SO OPT lib: $@) ++ $(HIDE)$(CC) -shared $^ -Wl,-soname -Wl,$(OPT_LIB_SHARED_NAME) -Wl,-version-script -Wl,libustr.ver $(LDFLAGS) -o $@ ++ ++$(DBG_LIB_SHARED): $(LIB_SHARED_DBG) ++ $(if $(HIDE), @echo Linking SO DBG lib: $@) ++ $(HIDE)$(CC) -shared $^ -Wl,-soname -Wl,$(DBG_LIB_SHARED_NAME) -Wl,-version-script -Wl,libustr.ver $(LDFLAGS) -o $@ ++ ++libustr.a: $(LIB_STATIC_OPT) ++ $(if $(HIDE), @echo Linking A OPT lib: $@) ++ $(HIDE)$(AR) ru $@ $^ ++ $(HIDE)$(RANLIB) $@ ++libustr-debug.a: $(LIB_STATIC_DBG) ++ $(if $(HIDE), @echo Linking A DBG lib: $@) ++ $(HIDE)$(AR) ru $@ $^ ++ $(HIDE)$(RANLIB) $@ ++ ++ustr-conf.h: ustr-conf.h.in config.status ++ ./config.status ++ ++ustr-conf-debug.h: ustr-conf-debug.h.in config.status ++ ./config.status ++ ++ ++# We don't use $(DEPS_NONC_ALL) as deps. because it then recompiles everything ++# too much, and we care about speed more. Do make clean to "fix". ++# Yes, scons fixes this. ++%-code-so-opt.o: %-opt-code.c %-code.h %.h $(DEPS_C_ALL) ++ $(if $(HIDE), @echo Compiling for SO OPT lib: $<) ++ $(HIDE)$(CC) $(CFLAGS) -fPIC $(CFLG_LIB_OPT) $(CPPFLAGS) -o $@ -c $< ++ ++%-code-so-dbg.o: %-dbg-code.c %-code.h %.h $(DEPS_C_ALL) ++ $(if $(HIDE), @echo Compiling for SO DBG lib: $<) ++ $(HIDE)$(CC) $(DBG_CFLAGS) -fPIC $(CFLG_LIB_DBG) $(CPPFLAGS) -o $@ -c $< ++ ++%-code-a-opt.o: %-opt-code.c %-code.h %.h $(DEPS_C_ALL) ++ $(if $(HIDE), @echo Compiling for A OPT lib: $<) ++ $(HIDE)$(CC) $(CFLAGS) $(CFLG_LIB_OPT) $(CPPFLAGS) -o $@ -c $< ++ ++%-code-a-dbg.o: %-dbg-code.c %-code.h %.h $(DEPS_C_ALL) ++ $(if $(HIDE), @echo Compiling for A DBG lib: $<) ++ $(HIDE)$(CC) $(DBG_CFLAGS) $(CFLG_LIB_DBG) $(CPPFLAGS) -o $@ -c $< ++ ++ ++perf-sizes: perf-sizes.c $(OBJS_C_OPT_ALL) ++ $(CC) $(WARNS) -O2 -g $(LDFLAGS) -o $@ $^ ++ ++perf-sizes32: perf-sizes.c $(OBJS_C_OPT_ALL) ++ $(CC) $(WARNS) -O2 -g $(LDFLAGS) -m32 -o $@ $^ ++ ++perf-sizes64: perf-sizes.c $(OBJS_C_OPT_ALL) ++ $(CC) $(WARNS) -O2 -g $(LDFLAGS) -m64 -o $@ $^ ++ ++# We "generate" the test files ... because "make clean" then makes the ++# dir. readble. And it helps coverage testing. ++tst_%.c: T/tst_%.c T/ctst_%.c ++ $(HIDE)cat $^ > $@ ++otst_%.c: T/tst_%.c T/ctst_%.c ++ $(HIDE)cat $^ > $@ ++ctst_%.c: T/ctst_%.c ++ $(HIDE)cat $< > $@ ++octst_%.c: T/ctst_%.c ++ $(HIDE)cat $< > $@ ++ ++# Debugging tst and "compiled" tst (links with libustr-debug) ++tst_%.o: tst_%.c tst.h $(DEPS_NONC_ALL) ++ $(if $(HIDE), @echo "Compiling: " $@) ++ $(HIDE)$(CC) $(DBG_CFLAGS) $(CFLG_TST_C) $(CPPFLAGS) -o $@ -c $< ++ ++tst_%: tst_%.o ++ $(HIDE)$(CC) $(LDFLAGS) -o $@ $< ++ ++ctst_%.o: ctst_%.c tst.h $(DEPS_C_ALL) ++ $(if $(HIDE), @echo "Compiling: " $@) ++ $(HIDE)$(CC) $(DBG_CFLAGS) $(CFLG_TST) $(CPPFLAGS) -o $@ -c $< ++ ++ctst_%: ctst_%.o $(OBJS_C_DBG_ALL) ++ $(HIDE)$(CC) $(LDFLAGS) -o $@ $^ ++ ++# Optimized tst and "compiled" tst (links with libustr) ++otst_%.o: otst_%.c tst.h $(DEPS_NONC_ALL) ++ $(if $(HIDE), @echo "Compiling: " $@) ++ $(HIDE)$(CC) $(CFLAGS) $(CFLG_TST_CO) $(CPPFLAGS) -o $@ -c $< ++ ++otst_%: otst_%.o ++ $(HIDE)$(CC) $(LDFLAGS) -o $@ $< ++ ++octst_%.o: octst_%.c tst.h $(DEPS_C_ALL) ++ $(if $(HIDE), @echo "Compiling:" $@) ++ $(HIDE)$(CC) $(CFLAGS) $(CFLG_TST_O) $(CPPFLAGS) -o $@ -c $< ++ ++octst_%: octst_%.o $(OBJS_C_OPT_ALL) ++ $(HIDE)$(CC) $(LDFLAGS) -o $@ $^ ++ ++ ++check-lcov: check ./scripts/lcov.sh ++ ./scripts/lcov.sh ++ ++# -------------------------------- ++# Borrowed from automake output... ++# -------------------------------- ++check: $(DBG_LIB_STATIC) $(TST_ALL) ++ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ ++ list=' $(TST_ALL) '; \ ++ if test -n "$$list"; then \ ++ for tst in $$list; do \ ++ if ./$$tst; then \ ++ all=`expr $$all + 1`; \ ++ case " $(XFAIL_TESTS) " in \ ++ *$$ws$$tst$$ws*) \ ++ xpass=`expr $$xpass + 1`; \ ++ failed=`expr $$failed + 1`; \ ++ echo "XPASS: $$tst"; \ ++ ;; \ ++ *) \ ++ echo "PASS: $$tst"; \ ++ ;; \ ++ esac; \ ++ elif test $$? -ne 77; then \ ++ all=`expr $$all + 1`; \ ++ case " $(XFAIL_TESTS) " in \ ++ *$$ws$$tst$$ws*) \ ++ xfail=`expr $$xfail + 1`; \ ++ echo "XFAIL: $$tst"; \ ++ ;; \ ++ *) \ ++ failed=`expr $$failed + 1`; \ ++ echo "FAIL: $$tst"; \ ++ ;; \ ++ esac; \ ++ else \ ++ skip=`expr $$skip + 1`; \ ++ echo "SKIP: $$tst"; \ ++ fi; \ ++ done; \ ++ if test "$$failed" -eq 0; then \ ++ if test "$$xfail" -eq 0; then \ ++ banner="All $$all tests passed"; \ ++ else \ ++ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ ++ fi; \ ++ else \ ++ if test "$$xpass" -eq 0; then \ ++ banner="$$failed of $$all tests failed"; \ ++ else \ ++ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ ++ fi; \ ++ fi; \ ++ dashes="$$banner"; \ ++ skipped=""; \ ++ if test "$$skip" -ne 0; then \ ++ skipped="($$skip tests were not run)"; \ ++ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ ++ dashes="$$skipped"; \ ++ fi; \ ++ report=""; \ ++ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ ++ report="Please report to $(PACKAGE_BUGREPORT)"; \ ++ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ ++ dashes="$$report"; \ ++ fi; \ ++ dashes=`echo "$$dashes" | sed s/./=/g`; \ ++ echo "$$dashes"; \ ++ echo "$$banner"; \ ++ test -z "$$skipped" || echo "$$skipped"; \ ++ test -z "$$report" || echo "$$report"; \ ++ echo "$$dashes"; \ ++ test "$$failed" -eq 0; \ ++ else :; fi ++ ++ ++.PRECIOUS: Makefile ++Makefile: Makefile.in config.status ++ ./config.status ++ ++config.status: configure ++ ./config.status --recheck ++ +diff --git a/aclocal.m4 b/aclocal.m4 +new file mode 100644 +index 0000000..95caa52 +--- /dev/null ++++ b/aclocal.m4 +@@ -0,0 +1,89 @@ ++# generated automatically by aclocal 1.14.1 -*- Autoconf -*- ++ ++# Copyright (C) 1996-2013 Free Software Foundation, Inc. ++ ++# This file is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without ++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A ++# PARTICULAR PURPOSE. ++ ++m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) ++# =========================================================================== ++# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) ++# ++# DESCRIPTION ++# ++# Check whether the given FLAG works with the current language's compiler ++# or gives an error. (Warnings, however, are ignored) ++# ++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on ++# success/failure. ++# ++# If EXTRA-FLAGS is defined, it is added to the current language's default ++# flags (e.g. CFLAGS) when the check is done. The check is thus made with ++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to ++# force the compiler to issue an error when a bad flag is given. ++# ++# INPUT gives an alternative input source to AC_COMPILE_IFELSE. ++# ++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this ++# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Guido U. Draheim ++# Copyright (c) 2011 Maarten Bosmans ++# ++# This program is free software: you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by the ++# Free Software Foundation, either version 3 of the License, or (at your ++# option) any later version. ++# ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program. If not, see . ++# ++# As a special exception, the respective Autoconf Macro's copyright owner ++# gives unlimited permission to copy, distribute and modify the configure ++# scripts that are the output of Autoconf when processing the Macro. You ++# need not follow the terms of the GNU General Public License when using ++# or distributing such scripts, even though portions of the text of the ++# Macro appear in them. The GNU General Public License (GPL) does govern ++# all other use of the material that constitutes the Autoconf Macro. ++# ++# This special exception to the GPL applies to versions of the Autoconf ++# Macro released by the Autoconf Archive. When you make and distribute a ++# modified version of the Autoconf Macro, you may extend this special ++# exception to the GPL to apply to your modified version as well. ++ ++#serial 3 ++ ++AC_DEFUN([AX_CHECK_COMPILE_FLAG], ++[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX ++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl ++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS ++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" ++ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], ++ [AS_VAR_SET(CACHEVAR,[yes])], ++ [AS_VAR_SET(CACHEVAR,[no])]) ++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) ++AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], ++ [m4_default([$2], :)], ++ [m4_default([$3], :)]) ++AS_VAR_POPDEF([CACHEVAR])dnl ++])dnl AX_CHECK_COMPILE_FLAGS ++ +diff --git a/autoconf_64b.c b/autoconf_64b.c +deleted file mode 100644 +index a900059..0000000 +--- a/autoconf_64b.c ++++ /dev/null +@@ -1,11 +0,0 @@ +-#include +-#include +- +-int main(void) +-{ /* output a "1" is it's a 64 bit platform. Major hack. */ +- size_t val = -1; +- +- puts((val == 0xFFFFFFFF) ? "0" : "1"); +- +- return 0; +-} +diff --git a/autoconf_vsnprintf.c b/autoconf_vsnprintf.c +deleted file mode 100644 +index 74689c0..0000000 +--- a/autoconf_vsnprintf.c ++++ /dev/null +@@ -1,177 +0,0 @@ +-#include +-#include +-#include +-#include +-#include +- +-#define USE_FMT_1_3 0 +- +-static int my_autoconf(const char *fmt, ...) +-{ +- va_list ap; +- char buf[1] = ""; +- int ret = -1; +- +- va_start(ap, fmt); +- ret = vsnprintf(buf, sizeof(buf), fmt, ap); +- va_end(ap); +- +- return (ret); +-} +- +-#if 0 +-static char *my_fmt0(const char *fmt, ...) +-{ +- char *tmp = NULL; +- va_list ap; +- int ret = -1; +- size_t lim = 32; +- char buf[1024] = ""; +- +- va_start(ap, fmt); +- ret = vsnprintf(buf, sizeof(buf), fmt, ap); +- va_end(ap); +- +-printf("fmt0\n"); +-printf("%d\n", ret); +- if (ret == -1) +- return (NULL); +- if ((size_t)ret > lim) +- return (NULL); +- +- if (!(tmp = malloc(ret + 1))) exit(1); +- +- va_start(ap, fmt); +- ret = vsnprintf(tmp, ret + 1, fmt, ap); /* assuming it works now */ +- va_end(ap); +-printf("%d\n", ret); +-printf("\n"); +- +- return (tmp); +-} +- +-static char *my_fmt1(const char *fmt, ...) +-{ +- char *tmp = NULL; +- va_list ap; +- int ret = -1; +- size_t sz = 1; +- +-printf("fmt1\n"); +- if (!(tmp = malloc(sz))) exit(1); +- tmp[0] = 0; +- +- va_start(ap, fmt); +- while ((ret = vsnprintf(tmp, sz, fmt, ap)) == -1) +- { +- printf("%d - %lu\n", ret, (unsigned long)strlen(tmp)); +- sz <<= 1; +- +- if (!(tmp = realloc(tmp, sz))) exit(1); +- if (sz > 1024) exit(2); +- +- va_end(ap); +- va_start(ap, fmt); +- } +- va_end(ap); +- +- if (sz <= (unsigned)ret) +- { +- sz = ret + 1; +- if (!(tmp = realloc(tmp, sz))) exit(1); +- +- va_start(ap, fmt); +- ret = vsnprintf(tmp, sz, fmt, ap); +- va_end(ap); +- } +- +-printf("%d\n", ret); +-printf("\n"); +- +- return (tmp); +-} +-#endif +- +-#if USE_FMT_1_3 +-static char *myx_vfmt(size_t lim, const char *fmt, va_list ap) +-{ +- char *tmp = NULL; +- va_list nap; +- int ret = -1; +- +- va_copy(nap, ap); +- ret = vsnprintf(NULL, 0, fmt, nap); +- va_end(nap); +- +-printf("%d\n", ret); +- if (ret == -1) +- return (NULL); +- if ((size_t)ret > lim) +- return (NULL); +- +- if (!(tmp = malloc(ret + 1))) +- { +- errno = ENOMEM; /* for EILSEQ etc. */ +- return (NULL); +- } +- +- ret = vsnprintf(tmp, ret + 1, fmt, ap); /* assuming it works now */ +-printf("%d\n", ret); +-printf("\n"); +- +- return (tmp); +-} +- +-static char *my_fmt2(const char *fmt, ...) +-{ +- va_list ap; +- char *ret = NULL; +- +- va_start(ap, fmt); +- ret = myx_vfmt(32, fmt, ap); +- va_end(ap); +- +- return (ret); +-} +- +-static char *my_vfmt(const char *fmt, va_list ap) +-{ return (myx_vfmt(32, fmt, ap)); } +- +-static char *my_fmt3(const char *fmt, ...) +-{ +- va_list ap; +- char *ret = NULL; +- +- va_start(ap, fmt); +- ret = my_vfmt(fmt, ap); +- va_end(ap); +- +- return (ret); +-} +-#endif +- +-int main(void) +-{ +-#if 0 +- char *tmp0 = my_fmt0("a b %d c d", 42); +- char *tmp1 = my_fmt1("a b %d c d", 42); +-#if USE_FMT_1_3 +- char *tmp2 = my_fmt2("a b %d c d", 42); +- char *tmp3 = my_fmt3("a b %d c d", 42); +-#endif +- +- if (tmp0) puts(tmp0); free(tmp0); +- if (tmp1) puts(tmp1); free(tmp1); +-#if USE_FMT_1_3 +- if (tmp2) puts(tmp2); free(tmp2); +- if (tmp3) puts(tmp3); free(tmp3); +-#endif +-#endif +- +- if (my_autoconf("12") == -1) +- puts("1"); +- else +- puts("0"); +- +- return 0; +-} +diff --git a/configure.ac b/configure.ac +new file mode 100644 +index 0000000..87fddda +--- /dev/null ++++ b/configure.ac +@@ -0,0 +1,121 @@ ++dnl Process this file with autoconf to produce a configure script. ++ ++AC_INIT(ustr, 1.0.4, [james@and.org], , [http://www.and.org/ustr/]) ++AC_PREFIX_DEFAULT(/usr) ++ ++# checks for programs ++AC_PROG_RANLIB ++AC_CHECK_TOOLS(AR, [ar], false) ++AC_PATH_PROG(LDCONFIG, [ldconfig], , ["$PATH:/sbin:/usr/sbin"]) ++# recent gcc with -Og ? ++AX_CHECK_COMPILE_FLAG([-Og], [DBG_CFLAGS_OPT="-Og"], [DBG_CFLAGS_OPT="-O1"], []) ++ ++# checks for header files ++AC_CHECK_HEADER([stdint.h], [HAVE_STDINT_H=1], [HAVE_STDINT_H=0]) ++ ++# checks for types ++AC_CHECK_SIZEOF([size_t]) ++test "$ac_cv_sizeof_size_t" -ge 8 && HAVE_64bit_SIZE_MAX=1 || HAVE_64bit_SIZE_MAX=0 ++ ++# check if we are using GNU C Library ++AC_MSG_CHECKING([GNU C library will be used]) ++AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ ++#include ++int version = __GLIBC__; ++ ]])], ++ [AC_MSG_RESULT([yes]); GLIBC_USED=1;], ++ [AC_MSG_RESULT([no]); GLIBC_USED=0;]) ++ ++# check if vsnprintf() is retarded ++define([check_vsnprintf_retarded_code], [[AC_LANG_SOURCE([[ ++#include ++#include ++#include ++#include ++#include ++ ++static int my_autoconf(const char *fmt, ...) ++{ ++ va_list ap; ++ char buf[1] = ""; ++ int ret = -1; ++ ++ va_start(ap, fmt); ++ ret = vsnprintf(buf, sizeof(buf), fmt, ap); ++ va_end(ap); ++ ++ return (ret); ++} ++ ++int main(void) ++{ ++ if (my_autoconf("12") == -1) { ++ puts("yes"); ++ return 1; ++ } else { ++ puts("no"); ++ return 0; ++ } ++} ++ ]])]]) ++AC_MSG_CHECKING([retarded vsnprintf()]) ++AC_RUN_IFELSE(check_vsnprintf_retarded_code, ++ [HAVE_RETARDED_VSNPRINTF=0], ++ [HAVE_RETARDED_VSNPRINTF=1], ++ [ ++ case 1 in ++ $GLIBC_USED) ++ AC_MSG_RESULT([can't test, assume not retarted in GLibC]) ++ HAVE_RETARDED_VSNPRINTF=0 ++ ;; ++ *) ++ AC_MSG_FAILURE([can't test vsnprintf() when cross compiling]) ++ ;; ++ esac ++ ] ++) ++ ++AC_MSG_CHECKING([building Debian package]) ++test -f "$srcdir/debian/control" -a -f "$srcdir/debian/rules" \ ++ && dpkg --version >/dev/null 2>&1 \ ++ && debian_build=1 ++if test -n "$debian_build" ++then ++ AC_MSG_RESULT([yes]) ++ # We are building Debian based distro packages... ++ SHRDIR=["$datadir/libustr-dev"] ++ DOCSHRDIR=["$datadir/doc/libustr-doc"] ++else ++ AC_MSG_RESULT([no]) ++ # The rest of the world... ++ SHRDIR=["$datadir/${PACKAGE_NAME}-${PACKAGE_VERSION}"] ++ DOCSHRDIR=["$datadir/doc/${PACKAGE_NAME}-devel-${PACKAGE_VERSION}"] ++fi ++ ++ ++AC_SUBST([DBG_CFLAGS_OPT]) ++AC_SUBST([HAVE_STDINT_H]) ++AC_SUBST([HAVE_64bit_SIZE_MAX]) ++AC_SUBST([HAVE_RETARDED_VSNPRINTF]) ++ ++# Compatibility vars ++# versions ++version_major=[$(echo $PACKAGE_VERSION | sed 's/^\([0-9]*\)\..*/\1/;')] ++version_minor=[$(echo $PACKAGE_VERSION | sed 's/^[0-9]*\.\([0-9]*\)\..*/\1/;')] ++version_release=[$(echo $PACKAGE_VERSION | sed 's/^[0-9]*\.[0-9]*\.\(.*\)/\1/;')] ++AC_SUBST([version_major]) ++AC_SUBST([version_minor]) ++AC_SUBST([version_release]) ++# paths ++EXAMDIR=["$DOCSHRDIR/examples"] ++MBINDIR=["$libexecdir/${PACKAGE_NAME}-${PACKAGE_VERSION}"] ++AC_SUBST([SHRDIR]) ++AC_SUBST([DOCSHRDIR]) ++AC_SUBST([EXAMDIR]) ++AC_SUBST([MBINDIR]) ++ ++ ++AC_CONFIG_FILES( [Makefile] ) ++AC_CONFIG_FILES( [ustr-conf.h ustr-conf-debug.h] ) ++AC_CONFIG_FILES( [ustr-import-multilib ustr-import] ) ++AC_OUTPUT +diff --git a/ustr-conf-debug.h.in b/ustr-conf-debug.h.in +new file mode 100644 +index 0000000..9c0e588 +--- /dev/null ++++ b/ustr-conf-debug.h.in +@@ -0,0 +1,75 @@ ++#ifndef USTR_CONF_H ++#define USTR_CONF_H 1 ++ ++/* this is the custom version for the library itself, for everyone else ++ * ustr-import generates one depending on the options. */ ++ ++/* The default is now to link against libc. */ ++#ifndef USTR_CONF_INCLUDE_CODEONLY_HEADERS ++#define USTR_CONF_INCLUDE_CODEONLY_HEADERS 0 ++#endif ++ ++/* We can't: if defined(__GLIBC__) && (!defined(_GNU_SOURCE) || !_GNU_SOURCE) ++ * because by the time we've included a libc header it's too late. */ ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE 1 ++#endif ++ ++/* maybe move memmem / memrchr here? */ ++ ++#if ! USTR_CONF_INCLUDE_CODEONLY_HEADERS ++/* If you aren't just using the headers, these should match the .c's */ ++ ++# define USTR_CONF_HAVE_64bit_SIZE_MAX @HAVE_64bit_SIZE_MAX@ ++# define USTR_CONF_HAVE_RETARDED_VSNPRINTF @HAVE_RETARDED_VSNPRINTF@ ++# define USTR_CONF_HAVE_STDINT_H @HAVE_STDINT_H@ ++# define USTR_CONF_HAVE_DYNAMIC_CONF 1 ++ ++# define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF ++ ++# define USTR_CONF_REF_BYTES 1 ++# define USTR_CONF_EXACT_BYTES 0 ++# define USTR_CONF_USE_SIZE 0 ++ ++# define USTR_CONF_USE_ASSERT 1 ++# define USTR_CONF_USE_EOS_MARK 1 ++ ++#else ++/* Same defaults, but can be altered at will. */ ++/* Note that you really shouldn't alter the _HAVE_* ones, but whatever */ ++ ++# ifndef USTR_CONF_HAVE_64bit_SIZE_MAX ++# define USTR_CONF_HAVE_64bit_SIZE_MAX @HAVE_64bit_SIZE_MAX@ ++# endif ++# ifndef USTR_CONF_HAVE_RETARDED_VSNPRINTF ++# define USTR_CONF_HAVE_RETARDED_VSNPRINTF @HAVE_RETARDED_VSNPRINTF@ ++# endif ++# ifndef USTR_CONF_HAVE_STDINT_H ++# define USTR_CONF_HAVE_STDINT_H @HAVE_STDINT_H@ ++# endif ++# ifndef USTR_CONF_HAVE_DYNAMIC_CONF ++# define USTR_CONF_HAVE_DYNAMIC_CONF 1 ++# endif ++ ++/* no USE_DYNAMIC_CONF ... use default in ustr-main.h */ ++ ++# ifndef USTR_CONF_REF_BYTES ++# define USTR_CONF_REF_BYTES 1 ++# endif ++# ifndef USTR_CONF_EXACT_BYTES ++# define USTR_CONF_EXACT_BYTES 0 ++# endif ++# ifndef USTR_CONF_USE_SIZE ++# define USTR_CONF_USE_SIZE 0 ++# endif ++ ++# ifndef USTR_CONF_USE_ASSERT ++# define USTR_CONF_USE_ASSERT 1 ++# endif ++# ifndef USTR_CONF_USE_EOS_MARK ++# define USTR_CONF_USE_EOS_MARK 1 ++# endif ++ ++#endif ++ ++#endif +diff --git a/ustr-conf.h.in b/ustr-conf.h.in +index ba8d650..a3ecbd6 100644 +--- a/ustr-conf.h.in ++++ b/ustr-conf.h.in +@@ -31,8 +31,8 @@ + # define USTR_CONF_EXACT_BYTES 0 + # define USTR_CONF_USE_SIZE 0 + +-# define USTR_CONF_USE_ASSERT @USE_ASSERT@ +-# define USTR_CONF_USE_EOS_MARK @USE_EOS_MARK@ ++# define USTR_CONF_USE_ASSERT 0 ++# define USTR_CONF_USE_EOS_MARK 0 + + #else + /* Same defaults, but can be altered at will. */ +@@ -64,10 +64,10 @@ + # endif + + # ifndef USTR_CONF_USE_ASSERT +-# define USTR_CONF_USE_ASSERT @USE_ASSERT@ ++# define USTR_CONF_USE_ASSERT 0 + # endif + # ifndef USTR_CONF_USE_EOS_MARK +-# define USTR_CONF_USE_EOS_MARK @USE_EOS_MARK@ ++# define USTR_CONF_USE_EOS_MARK 0 + # endif + + #endif +diff --git a/ustr-import-multilib.in b/ustr-import-multilib.in +index 0656b2a..bd03182 100644 +--- a/ustr-import-multilib.in ++++ b/ustr-import-multilib.in +@@ -1,6 +1,8 @@ + #! /bin/sh -e + +-INCDIR=@INCLUDEDIR@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++INCDIR=@includedir@ + MBINDIR=@MBINDIR@ + + NOT_DONE=1 +diff --git a/ustr-import.in b/ustr-import.in +index 45c8277..fd1b30f 100644 +--- a/ustr-import.in ++++ b/ustr-import.in +@@ -1,9 +1,10 @@ + #! /bin/sh -e + +-INCDIR=@INCLUDEDIR@ ++prefix=@prefix@ ++datarootdir=@datarootdir@ ++INCDIR=@includedir@ + SHRDIR=@SHRDIR@ +-VERS=@VERS@ +-VERS_FULL=@VERS_FULL@ ++PACKAGE_VERSION=@PACKAGE_VERSION@ + autoconf_64b=@HAVE_64bit_SIZE_MAX@ + autoconf_vsnprintf=@HAVE_RETARDED_VSNPRINTF@ + +@@ -47,7 +48,7 @@ usage() + echo " sub = Substituting data" + echo " utf8 = Working with UTF8" + echo "" +- echo " Ustr Version: $VERS_FULL" ++ echo " Ustr Version: $PACKAGE_VERSION" + exit $1 + } + +-- +tg: (b148fb7..) fixes/autoconf (depends on: upstream) diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/ustr/files/doc-html-local-css.diff b/sdk_container/src/third_party/coreos-overlay/dev-libs/ustr/files/doc-html-local-css.diff new file mode 100644 index 0000000000..1d5ee5664b --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/ustr/files/doc-html-local-css.diff @@ -0,0 +1,63 @@ +From: Václav Ovsík +Subject: [PATCH] fixes/doc-html-local-css + +This patch replaces remote link to CSS with local copy. +Original link: http://www.and.org/f_c-1.0.css + +Signed-off-by: Václav Ovsík + +--- + Documentation/design.html | 2 +- + Documentation/f_c-1.0.css | 1 + + Documentation/index.html | 2 +- + Documentation/tutorial.html | 2 +- + 4 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/Documentation/design.html b/Documentation/design.html +index a13e950..5ccc8ff 100644 +--- a/Documentation/design.html ++++ b/Documentation/design.html +@@ -2,7 +2,7 @@ + + + Design of ustr, the micro string API - for C +- + +