1Fix cross link using autoconf detected AR 2 3If building on 32bit host and creating 64bit libraries, the target 4package builds should not invoke the 32bit hosts's ar. Specifically 5you will get an error message like: 6 7x86_64-linux-gcc -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -g -o test test.o libnewt.a -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lslang 8libnewt.a: could not read symbols: Archive has no index; run ranlib to add one 9collect2: error: ld returned 1 exit status 10 11Signed-off-by: Jason Wessel <jason.wessel@windriver.com> 12 13Upstream-Status: Pending 14 15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 16--- 17 Makefile.in | 3 ++- 18 configure.ac | 4 ++++ 19 2 files changed, 6 insertions(+), 1 deletion(-) 20 21Index: newt-0.52.20/Makefile.in 22=================================================================== 23--- newt-0.52.20.orig/Makefile.in 24+++ newt-0.52.20/Makefile.in 25@@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@ 26 LDFLAGS = @LDFLAGS@ 27 CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ 28 GNU_LD = @GNU_LD@ 29+AR = @AR@ 30 31 VERSION = @VERSION@ 32 TAG = r$(subst .,-,$(VERSION)) 33@@ -109,7 +110,7 @@ whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNE 34 $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS) 35 36 $(LIBNEWT): $(LIBOBJS) 37- ar rv $@ $^ 38+ $(AR) rv $@ $^ 39 40 newt.o $(SHAREDDIR)/newt.o: newt.c Makefile 41 42Index: newt-0.52.20/configure.ac 43=================================================================== 44--- newt-0.52.20.orig/configure.ac 45+++ newt-0.52.20/configure.ac 46@@ -15,6 +15,10 @@ AC_PROG_INSTALL 47 AC_PROG_LN_S 48 AC_PROG_GREP 49 AC_SYS_LARGEFILE 50+AN_MAKEVAR([AR], [AC_PROG_AR]) 51+AN_PROGRAM([ar], [AC_PROG_AR]) 52+AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) 53+AC_PROG_AR 54 55 AC_CHECK_SIZEOF([long]) 56 AC_CHECK_SIZEOF([long long]) 57