pkgsrc-ng/devel/py-newt/patches/patch-Makefile.in
2014-08-11 13:27:10 +02:00

184 lines
7.5 KiB
Plaintext

$NetBSD: patch-Makefile.in,v 1.1 2014/01/01 06:55:23 ryoon Exp $
* Libtoolized
* Use configure.ac's Python version
--- Makefile.in.orig 2013-08-06 15:46:42.000000000 +0000
+++ Makefile.in
@@ -16,7 +16,7 @@ SOEXT = so
PYTHONVERS = @PYTHONVERS@
WHIPTCLLIB = @WHIPTCLLIB@
ifneq ($(WHIPTCLLIB),)
-WHIPTCLSO = $(WHIPTCLLIB).$(SOEXT)
+WHIPTCLSO = $(WHIPTCLLIB).la
else
WHIPTCLSO =
endif
@@ -25,18 +25,12 @@ PROGS = test whiptail $(WHIPTCLSO) testg
TESTOBJS = test.o testgrid.o testtree.o showchars.o showkey.o
NDIALOGOBJS = whiptail.o dialogboxes.o
WHIPTCLOBJS = shared/whiptcl.o shared/dialogboxes.o
-LIBNEWT = libnewt.a
-LIBNEWTSH = libnewt.$(SOEXT).$(VERSION)
-LIBNEWTSONAME = libnewt.$(SOEXT).$(SONAME)
+LIBNEWT = libnewt.la
LIBOBJS = newt.o button.o form.o checkbox.o entry.o label.o listbox.o \
scrollbar.o textbox.o scale.o grid.o windows.o buttonbar.o \
checkboxtree.o
-ifneq ($(GNU_LD),)
-SHLIBFLAGS= -Wl,--version-script,newt.0.52.ver -Wl,-soname,$(LIBNEWTSONAME)
-else
-SHLIBFLAGS=
-endif
+SHLIBFLAGS= -shared
SHCFLAGS = -fPIC
@@ -56,6 +50,10 @@ instroot ?= $(DESTDIR)
SOURCES = $(subst .o,.c,$(TESTOBJS) $(NDIALOGOBJS) $(LIBOBJS))
+NDIALOGLOBJS = $(subst .o,.lo, $(NDIALOGOBJS))
+WHIPTCLLOBJS = $(subst .o,.lo,$(WHIPTCLOBJS))
+LIBLOBJS = $(subst .o,.lo, $(LIBOBJS))
+
SHAREDDIR = shared
SHAREDOBJS = $(patsubst %,$(SHAREDDIR)/%, $(LIBOBJS))
@@ -65,59 +63,61 @@ else
TARGET=depend $(PROGS)
endif
-all: $(TARGET) _snackmodule.$(SOEXT)
+all: $(TARGET) _snackmodule.la
test: test.o $(LIBNEWT)
- $(CC) -g -o test test.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
+ ${LIBTOOL} --mode=link $(CC) -g -o test test.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
testgrid: testgrid.o $(LIBNEWT)
- $(CC) -g -o testgrid testgrid.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
+ ${LIBTOOL} --mode=link $(CC) -g -o testgrid testgrid.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
testtree: testtree.o $(LIBNEWT)
- $(CC) -g -o testtree testtree.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
+ ${LIBTOOL} --mode=link $(CC) -g -o testtree testtree.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
showchars: showchars.o $(LIBNEWT)
- $(CC) -g -o showchars showchars.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
+ ${LIBTOOL} --mode=link $(CC) -g -o showchars showchars.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
showkey: showkey.o $(LIBNEWT)
- $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
+ ${LIBTOOL} --mode=link $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
-_snackmodule.$(SOEXT): snackmodule.c $(LIBNEWTSH)
+_snackmodule.la: snackmodule.c $(LIBNEWT)
@[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS); do \
- pyconfig=$$ver-config; \
+ pyconfig=python$$ver-config; \
if ! $$pyconfig --cflags > /dev/null 2>&1 && \
python-config --cflags > /dev/null 2>&1; then \
echo $$pyconfig not found, using python-config; \
pyconfig=python-config; \
fi; \
- mkdir -p $$ver; \
+ mkdir -p python$$ver; \
PCFLAGS=`$$pyconfig --cflags`; \
PIFLAGS=`$$pyconfig --includes`; \
PLDFLAGS=`$$pyconfig --ldflags`; \
PLFLAGS=`$$pyconfig --libs`; \
- echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \
- $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \
- echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.$(SOEXT) $$ver/snackmodule.o -L. -lnewt $(LIBS); \
- $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.$(SOEXT) $$ver/snackmodule.o -L. -lnewt $(LIBS); \
+ ${LIBTOOL} --mode=compile $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o python$$ver/snackmodule.lo snackmodule.c; \
+ ${LIBTOOL} --mode=link $(CC) -module -shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o python$$ver/_snackmodule.la python$$ver/snackmodule.lo libnewt.la $(LIBS) -rpath ${PREFIX}/lib/python$$ver/site-packages ; \
done || :
touch $@
-whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
- $(CC) -g -o whiptail $(NDIALOGOBJS) -L. $(LDFLAGS) -lnewt $(LIBS) -lpopt
+whiptail: $(NDIALOGLOBJS) $(LIBNEWT)
+ ${LIBTOOL} --mode=link $(CC) -g -o whiptail $(NDIALOGLOBJS) $(LDFLAGS) libnewt.la $(LIBS) -lpopt
-whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNEWTSH)
- $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS)
+whiptcl.la: $(WHIPTCLLOBJS) $(LIBNEWT)
+ ${LIBTOOL} --mode=link $(CC) -module -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.la $(WHIPTCLLOBJS) libnewt.la $(LIBTCL) -lpopt $(LIBS) -rpath ${PREFIX}/lib
-$(LIBNEWT): $(LIBOBJS)
- ar rv $@ $^
+$(LIBNEWT): $(LIBLOBJS)
+ ${LIBTOOL} --mode=link \
+ ${CC} -o $@ \
+ ${LIBLOBJS} \
+ -rpath ${PREFIX}/lib \
+ -version-info 0:52
-newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
+newt.lo $(SHAREDDIR)/newt.lo: newt.c Makefile
veryclean: clean
rm -f .depend *.pc
clean:
- rm -f $(PROGS) *.o $(LIBNEWT) core $(LIBNEWTSH) \
+ rm -f $(PROGS) *.o $(LIBNEWT) core $(LIBNEWT) \
$(SHAREDDIR)/*.o *.$(SOEXT)*
depend:
@@ -126,15 +126,13 @@ depend:
$(SHAREDDIR):
mkdir -p $(SHAREDDIR)
-sharedlib: $(LIBNEWTSH)
+sharedlib: $(LIBNEWT)
-$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
- $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS)
- ln -fs $(LIBNEWTSONAME) libnewt.$(SOEXT)
- ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
+%.lo : %.c
+ ${LIBTOOL} --mode=compile $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
-$(SHAREDDIR)/%.o : %.c
- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
+$(SHAREDDIR)/%.lo : %.c
+ ${LIBTOOL} --mode=compile $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
install: $(LIBNEWT) install-sh whiptail
[ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
@@ -143,22 +141,19 @@ install: $(LIBNEWT) install-sh whiptail
[ -d $(instroot)/$(man1dir) ] || install -m 755 -d $(instroot)/$(man1dir)
[ -d $(instroot)/$(pkgconfigdir) ] || install -m 755 -d $(instroot)/$(pkgconfigdir)
install -m 644 newt.h $(instroot)/$(includedir)
- install -m 644 $(LIBNEWT) $(instroot)/$(libdir)
- install -m 755 whiptail $(instroot)/$(bindir)
- install -m 644 whiptail.1 $(instroot)/$(man1dir)
+ ${LIBTOOL} --mode=install install -m 755 whiptail $(instroot)/$(bindir)
+ ${LIBTOOL} --mode=install install -m 644 whiptail.1 $(instroot)/$(man1dir)
make -C po datadir=$(instroot)/$(datadir) install
install -m 644 libnewt.pc $(instroot)/$(pkgconfigdir)
-install-sh: sharedlib $(WHIPTCLSO) _snackmodule.$(SOEXT)
+install-sh: sharedlib $(WHIPTCLSO) _snackmodule.la
[ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
- install -m 755 $(LIBNEWTSH) $(instroot)/$(libdir)
- ln -sf $(LIBNEWTSONAME) $(instroot)/$(libdir)/libnewt.$(SOEXT)
- ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME)
- [ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.$(SOEXT) $(instroot)/$(libdir) || :
+ ${LIBTOOL} --mode=install install -m 755 $(LIBNEWT) $(instroot)/$(libdir)
+ [ -n "$(WHIPTCLSO)" ] && ${LIBTOOL} --mode=install install -m 755 whiptcl.la $(instroot)/$(libdir) || :
[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \
- [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\
- install -m 755 $$ver/_snackmodule.$(SOEXT) $(instroot)/$(libdir)/$$ver/site-packages ;\
- install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
+ [ -d $(instroot)/$(libdir)/python$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/python$$ver/site-packages ;\
+ ${LIBTOOL} --mode=install install -m 755 python$$ver/_snackmodule.la $(instroot)/$(libdir)/python$$ver/site-packages ;\
+ install -m 644 snack.py $(instroot)/$(libdir)/python$$ver/site-packages ;\
done || :
Makefile: newt.spec