The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ustr / 0001-cross-compile-modifications.patch
1 Changes are to allow ustr version 1.0.4 to cross compile in buildroot.
2
3 Signed-off-by Clayton Shotwell <clshotwe@rockwellcollins.com>
4
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
8 @@ -13,10 +13,10 @@
9  
10  /* We assume this is enough,
11   * C99 specifies that va_copy() exists and is a macro */
12 -#ifdef va_copy
13 +#if defined va_copy
14  # define USTR_CONF_HAVE_VA_COPY 1
15  # define USTR__VA_COPY(x, y)   va_copy(x, y)
16 -#elif __va_copy
17 +#elif defined __va_copy
18  # define USTR_CONF_HAVE_VA_COPY 1
19  # define USTR__VA_COPY(x, y) __va_copy(x, y)
20  #else
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
24 @@ -8,8 +8,8 @@
25  VERS_ESONAME =1
26  VERS_ESO     =$(VERS_ESONAME).0.4
27  
28 -DESTDIR =
29 -prefix=/usr
30 +DESTDIR ?= 
31 +prefix ?= /usr
32  datadir=$(prefix)/share
33  libdir=$(prefix)/lib
34  libexecdir=$(prefix)/libexec
35 @@ -18,7 +18,7 @@
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)
42  
43  ###############################################################################
44 @@ -28,12 +28,12 @@
45  ###############################################################################
46  HIDE=@
47  
48 -CC = cc
49 -AR = ar
50 -RANLIB = ranlib
51 -LDCONFIG = /sbin/ldconfig
52 +CC ?= cc
53 +AR ?= ar
54 +RANLIB ?= ranlib
55  
56 -CFLAGS  = -O2 -g
57 +CFLAGS ?= -O2 -g
58 +LDFLAGS ?= 
59  
60  # Debug versions...
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
62 @@ -376,7 +376,7 @@
63  all-shared: all $(LIB_SHARED)
64                 $(HIDE)echo Done shared
65  
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)
71 @@ -389,16 +389,6 @@
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)
88 @@ -409,13 +399,24 @@
89                 install -m 755 -t $(DESTDIR)$(bindir) ustr-import
90                 install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc ustr-debug.pc
91  
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)
103 +
104  ustr-import-multilib: ustr-import-multilib.in
105                 sed -e 's,@INCLUDEDIR@,$(includedir),g' -e 's,@MBINDIR@,$(MBINDIR),g' < $< > $@
106  
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 \
115 @@ -451,7 +452,8 @@
116  
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" < $< > $@
123                 $(HIDE)chmod 755 $@
124  
125 @@ -485,7 +487,8 @@
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; \
135 @@ -494,7 +497,8 @@
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; \