newt: fix compile errors caused by using the wrong ar util
[packages.git] / libs / newt / patches / 100-compile-fix-broken-makefile.patch
1 --- a/Makefile.in
2 +++ b/Makefile.in
3 @@ -4,7 +4,8 @@ LIBTCL = -ltcl8.4
4  CC = @CC@
5  CPP = @CPP@
6  CFLAGS = @CFLAGS@
7 -CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@ 
8 +AR ?= ar
9 +CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
10  
11  SHLIBFLAGS= -Wl,--version-script,newt.0.52.ver
12  VERSION = @VERSION@
13 @@ -53,19 +54,19 @@ endif
14  all:   $(TARGET) _snackmodule.so
15  
16  test:  test.o $(LIBNEWT)
17 -       $(CC) -g -o test test.o $(LIBNEWT) $(LIBS)
18 +       $(CC) $(CFLAGS) -g -o test test.o $(LIBNEWT) $(LIBS)
19  
20  testgrid:      testgrid.o $(LIBNEWT)
21 -       $(CC) -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS)
22 +       $(CC) $(CFLAGS) -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS)
23  
24  testtree:      testtree.o $(LIBNEWT)
25 -       $(CC) -g -o testtree testtree.o $(LIBNEWT) $(LIBS)
26 +       $(CC) $(CFLAGS) -g -o testtree testtree.o $(LIBNEWT) $(LIBS)
27  
28  showchars:     showchars.o $(LIBNEWT)
29 -       $(CC) -g -o showchars showchars.o $(LIBNEWT) $(LIBS)
30 +       $(CC) $(CFLAGS) -g -o showchars showchars.o $(LIBNEWT) $(LIBS)
31  
32  showkey:       showkey.o $(LIBNEWT)
33 -       $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LIBS)
34 +       $(CC) $(CFLAGS) -g -o showkey showkey.o $(LIBNEWT) $(LIBS)
35  
36  _snackmodule.so:   snackmodule.c $(LIBNEWTSH)
37         for ver in $(PYTHONVERS) ; do \
38 @@ -76,13 +77,13 @@ _snackmodule.so:   snackmodule.c $(LIBNE
39         touch $@
40  
41  whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
42 -       $(CC) -g -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS) -lpopt
43 +       $(CC) $(CFLAGS) -g -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS) -lpopt
44  
45  whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH)
46         $(CC) -shared $(SHCFLAGS) -o whiptcl.so $(WHIPTCLOBJS) -L . -lnewt  $(LIBTCL) -lpopt
47  
48  $(LIBNEWT): $(LIBOBJS)
49 -       ar rv $@ $^
50 +       $(AR) rv $@ $^
51  
52  newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
53  
54 @@ -102,12 +103,12 @@ $(SHAREDDIR):
55  sharedlib: $(LIBNEWTSH)
56  
57  $(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
58 -       $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS)
59 +       $(CC) $(CFLAGS) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS)
60         ln -fs $(LIBNEWTSONAME) libnewt.so
61         ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
62  
63  $(SHAREDDIR)/%.o : %.c
64 -       $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
65 +       $(CC) $(CFLAGS) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
66  
67  install: $(LIBNEWT) install-sh whiptail
68         [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)