Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Fix cross link using autoconf detected AR |
| 2 | |
| 3 | If building on 32bit host and creating 64bit libraries, the target |
| 4 | package builds should not invoke the 32bit hosts's ar. Specifically |
| 5 | you will get an error message like: |
| 6 | |
| 7 | x86_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 |
| 8 | libnewt.a: could not read symbols: Archive has no index; run ranlib to add one |
| 9 | collect2: error: ld returned 1 exit status |
| 10 | |
| 11 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
| 12 | |
| 13 | Upstream-Status: Pending |
| 14 | |
| 15 | Signed-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 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | Index: newt-0.52.20/Makefile.in |
| 22 | =================================================================== |
| 23 | --- newt-0.52.20.orig/Makefile.in |
| 24 | +++ newt-0.52.20/Makefile.in |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | @@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@ |
| 26 | LDFLAGS = @LDFLAGS@ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 27 | CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | GNU_LD = @GNU_LD@ |
| 29 | +AR = @AR@ |
| 30 | |
| 31 | VERSION = @VERSION@ |
| 32 | TAG = r$(subst .,-,$(VERSION)) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 33 | @@ -109,7 +110,7 @@ whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNE |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 42 | Index: newt-0.52.20/configure.ac |
| 43 | =================================================================== |
| 44 | --- newt-0.52.20.orig/configure.ac |
| 45 | +++ newt-0.52.20/configure.ac |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 55 | AC_CHECK_SIZEOF([long]) |
| 56 | AC_CHECK_SIZEOF([long long]) |