1 Changes are to allow ustr version 1.0.4 to cross compile in buildroot.
3 Signed-off-by Clayton Shotwell <clshotwe@rockwellcollins.com>
5 diff -urN a/ustr-compiler.h b/ustr-compiler.h
6 --- a/ustr-compiler.h 2008-02-15 14:12:28.000000000 -0600
7 +++ b/ustr-compiler.h 2012-06-15 11:04:55.000000000 -0500
10 /* We assume this is enough,
11 * C99 specifies that va_copy() exists and is a macro */
14 # define USTR_CONF_HAVE_VA_COPY 1
15 # define USTR__VA_COPY(x, y) va_copy(x, y)
17 +#elif defined __va_copy
18 # define USTR_CONF_HAVE_VA_COPY 1
19 # define USTR__VA_COPY(x, y) __va_copy(x, y)
21 diff -urN a/Makefile b/Makefile
22 --- a/Makefile 2008-03-05 21:38:00.000000000 -0600
23 +++ b/Makefile 2013-09-10 16:54:45.916874387 -0500
26 VERS_ESO =$(VERS_ESONAME).0.4
32 datadir=$(prefix)/share
34 libexecdir=$(prefix)/libexec
36 SHRDIR=$(datadir)/ustr-$(VERS_FULL)
37 DOCSHRDIR=$(datadir)/doc/ustr-devel-$(VERS_FULL)
38 EXAMDIR=$(SHRDIR)/examples
39 -mandir=$(datadir)/doc/man
40 +mandir=$(datadir)/man
41 MBINDIR=$(libexecdir)/ustr-$(VERS_FULL)
43 ###############################################################################
45 ###############################################################################
51 -LDCONFIG = /sbin/ldconfig
61 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
63 all-shared: all $(LIB_SHARED)
64 $(HIDE)echo Done shared
66 -install: all-shared ustr.pc ustr-debug.pc
67 +install: all ustr.pc ustr-debug.pc
68 $(HIDE)echo Making directories
69 install -d $(DESTDIR)$(libdir)
70 install -d $(DESTDIR)$(includedir)
72 install -d $(DESTDIR)$(libdir)/pkgconfig
73 $(HIDE)echo Installing files
74 install -m 644 -t $(DESTDIR)$(libdir) $(LIB_STATIC)
75 - install -m 755 -t $(DESTDIR)$(libdir) $(LIB_SHARED)
76 - -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
77 - ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
78 - -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
79 - ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
80 - -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
81 - ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
82 - -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
83 - ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
84 - $(LDCONFIG) -n $(DESTDIR)$(libdir)
85 install -pm 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS)
86 install -pm 644 -t $(DESTDIR)$(SHRDIR) $(SRC_SRCS)
87 install -pm 644 -t $(DESTDIR)$(SHRDIR) $(XSRC_SRCS)
89 install -m 755 -t $(DESTDIR)$(bindir) ustr-import
90 install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc ustr-debug.pc
92 +install-shared: all-shared install
93 + $(HIDE)echo Installing files
94 + install -m 755 -t $(DESTDIR)$(libdir) $(LIB_SHARED)
95 + -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
96 + ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
97 + -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
98 + ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
99 + -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
100 + ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
101 + -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
102 + ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
104 ustr-import-multilib: ustr-import-multilib.in
105 sed -e 's,@INCLUDEDIR@,$(includedir),g' -e 's,@MBINDIR@,$(MBINDIR),g' < $< > $@
107 install-multilib-linux: install autoconf_64b ustr-import-multilib
108 install -d $(DESTDIR)$(MBINDIR)
109 - $(HIDE)mlib=`./autoconf_64b`; \
110 - if test "x$$mlib" = "x1"; then mlib=64; else mlib=32; fi; \
111 + $(HIDE))if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then mlib=64; else mlib=32; fi; \
112 mv -f $(DESTDIR)$(includedir)/ustr-conf-debug.h \
113 $(DESTDIR)$(includedir)/ustr-conf-debug-$$mlib.h; \
114 mv -f $(DESTDIR)$(includedir)/ustr-conf.h \
117 ustr-import: ustr-import.in autoconf_64b autoconf_vsnprintf
118 $(HIDE)echo Creating $@
119 - $(HIDE)sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
120 + $(HIDE)if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then sz64=1; else sz64=0; fi; \
121 + if test "`./autoconf_vsnprintf`" = 0; then vsnp=0; else vsnp=1; fi; \
122 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" < $< > $@
126 ustr-conf.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
127 $(HIDE)echo Creating $@
128 $(HIDE)have_stdint_h=0; dbg1=0; dbg2=0; \
129 - sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
130 + if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then sz64=1; else sz64=0; fi; \
131 + if test "`./autoconf_vsnprintf`" = 0; then vsnp=0; else vsnp=1; fi; \
132 if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
133 if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
134 if test -f "$(includedir)/stdint.h"; then have_stdint_h=1; fi; \
136 ustr-conf-debug.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
137 $(HIDE)echo Creating $@
138 $(HIDE)have_stdint_h=0; dbg1=1; dbg2=1; \
139 - sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
140 + if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then sz64=1; else sz64=0; fi; \
141 + if test "`./autoconf_vsnprintf`" = 0; then vsnp=0; else vsnp=1; fi; \
142 if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
143 if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
144 if test -f "$(includedir)/stdint.h"; then have_stdint_h=1; fi; \