ports/devel/newt/files/patch-ab
Ying-Chieh Liao 66de760280 - Update to 0.50.33-1
- make TCL and Python module optional.
- take a maintainership

PR:		36001
Submitted by:	Hye-Shik Chang <perky@fallin.lv>
2002-03-17 12:09:03 +00:00

166 lines
5 KiB
Text

--- Makefile.in.orig Tue Jan 23 15:27:38 2001
+++ Makefile.in Sun Mar 17 17:46:32 2002
@@ -1,18 +1,14 @@
-LIBS = -lslang -lm #-lefence
-SHLIBS = -lslang -lm -lc
+CC ?= cc
+LIBS = -L$(PREFIX)/lib -lslang -lpopt -lncurses -lm
+TCLLIBS = -l${TCLVERSION:S/.//g}
+SHLIBS = $(LIBS)
-GPM_SUPPORT=@gpm_support@
+CFLAGS = $(PCFLAGS) -Wall -I$(prefix)/include -I$(prefix)/include/${TCLVERSION}
-CFLAGS = $(RPM_OPT_FLAGS) -Wall -I/usr/include/slang
-ifeq ($(RPM_OPT_FLAGS),)
-CFLAGS += -g # -O2 -I/usr/include/slang
-endif
+VERSION ?= 0
+SONAME = ${VERSION}
-VERSION = @VERSION@
-CVSTAG = r$(subst .,-,$(VERSION))
-SONAME = @SONAME@
-
-PROGS = test whiptail whiptcl.so testgrid testtree
+PROGS = test whiptail testgrid testtree
TESTOBJS = test.o
NDIALOGOBJS = whiptail.o dialogboxes.o
WHIPTCLOBJS = whiptcl.o dialogboxes.o
@@ -25,51 +21,50 @@
SHCFLAGS = -fPIC
-prefix = /usr
+prefix ?= ${PREFIX}
includedir = $(prefix)/include
libdir = $(prefix)/lib
bindir = $(prefix)/bin
-ARCHNAME = $(shell uname -m | sed 's/i.86/i386/')
pythondir = $(prefix)/lib/python1.5
pythonbindir = $(prefix)/lib/python1.5/lib-dynload
#--------------------------------------
-SOURCES = $(subst .o,.c,$(TESTOBJS) $(NDIALOGOBJS) $(LIBOBJS))
+SOURCES = ${TESTOBJS:S/.o/.c/g} ${NDIALOGOBJS:S/.o/.c/g} ${LIBOBJS:S/.o/.c/g}
SHAREDDIR = shared
SHAREDOBJS = $(patsubst %,$(SHAREDDIR)/%, $(LIBOBJS))
+.if defined(WITH_TCL)
+TCLTARGET=whiptcl.so
+.endif
+TARGET=${PROGS} ${TCLTARGET}
+
+.if !exists(.depend)
+TARGET+=depend
+.endif
-ifeq (.depend,$(wildcard .depend))
-TARGET=$(PROGS)
-else
-TARGET=depend $(PROGS)
-endif
-
-all: $(TARGET) _snackmodule.so
+all: $(TARGET)
test: $(TESTOBJS) $(LIBNEWT)
- gcc -g -o test $(TESTOBJS) $(LIBNEWT) $(LIBS) -static
+ $(CC) -o test $(TESTOBJS) $(LIBNEWT) $(LIBS) -static
testgrid: testgrid.o $(LIBNEWT)
- gcc -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS)
+ $(CC) -o testgrid testgrid.o $(LIBNEWT) $(LIBS)
testtree: testtree.o $(LIBNEWT)
- gcc -g -o testtree testtree.o $(LIBNEWT) $(LIBS)
-
-_snackmodule.so: snackmodule.o $(LIBNEWTSH)
- gcc --shared $(SHCFLAGS) -o _snackmodule.so snackmodule.o -L . $(LIBNEWTSH)
-
-snackmodule.o: snackmodule.c
- gcc -I/usr/include/python1.5 -fPIC $(CFLAGS) -c snackmodule.c
+ $(CC) -o testtree testtree.o $(LIBNEWT) $(LIBS)
whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
- gcc -g -o whiptail $(NDIALOGOBJS) -L . $(LIBNEWTSH) $(LIBS) -lpopt
+ $(CC) -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS)
+.if defined(WITH_TCL)
whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH)
- gcc -shared $(SHCFLAGS) -o whiptcl.so $(WHIPTCLOBJS) -L . $(LIBNEWTSH) -ltcl -lslang -lpopt -lm
+ $(CC) -shared -o whiptcl.so $(WHIPTCLOBJS) -L . -lnewt $(LIBS) $(TCLLIBS)
+.endif
-$(LIBNEWT): $(LIBNEWT)($(LIBOBJS))
+$(LIBNEWT): $(LIBOBJS)
+ ar q ${LIBNEWT} ${LIBOBJS}
+ ranlib ${LIBNEWT}
newt.o: newt.c Makefile
$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
@@ -82,7 +77,7 @@
$(SHAREDOBJS) *.so*
depend:
- $(CPP) $(CFLAGS) -M $(SOURCES) > .depend
+ mkdep $(CFLAGS) $(SOURCES)
$(SHAREDDIR):
mkdir -p $(SHAREDDIR)
@@ -90,7 +85,7 @@
sharedlib: $(LIBNEWTSH)
$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
- gcc -shared -o $(LIBNEWTSH) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(SHLIBS)
+ $(CC) -shared -o $(LIBNEWTSH) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(SHLIBS)
$(SHAREDDIR)/%.o : %.c
$(CC) $(SHCFLAGS) -c $(CFLAGS) -o $@ $<
@@ -100,21 +95,20 @@
install: $(LIBNEWT) install-sh whiptail
- [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
- [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
- [ -d $(instroot)/$(includedir) ] || install -m 755 -d $(instroot)/$(includedir)
- install -m 644 newt.h $(instroot)/$(includedir)
- install -m 644 $(LIBNEWT) $(instroot)/$(libdir)
- install -s -m 755 whiptail $(instroot)/$(bindir)
-
-install-sh: sharedlib whiptcl.so _snackmodule.so
- [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
- install -s -m 755 $(LIBNEWTSH) $(instroot)/$(libdir)
- ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/libnewt.so
- install -s -m 755 whiptcl.so $(instroot)/$(libdir)
- [ -d $(instroot)/$(pythonbindir) ] || install -m 755 -d $(instroot)/$(pythonbindir)
- install -s -m 755 _snackmodule.so $(instroot)/$(pythonbindir)
- install -m 755 snack.py $(instroot)/$(pythondir)
+ [ -d $(bindir) ] || install -m 755 -d $(bindir)
+ [ -d $(libdir) ] || install -m 755 -d $(libdir)
+ [ -d $(includedir) ] || install -m 755 -d $(includedir)
+ install -c -m 644 newt.h $(includedir)
+ install -c -m 644 $(LIBNEWT) $(libdir)
+ install -c -s -m 755 whiptail $(bindir)
+
+install-sh: sharedlib ${TCLTARGET}
+ [ -d $(libdir) ] || install -m 755 -d $(libdir)
+ install -c -m 755 $(LIBNEWTSH) $(libdir)
+ ln -sf $(LIBNEWTSH) $(libdir)/libnewt.so
+.if defined(WITH_TCL)
+ install -c -m 755 whiptcl.so $(libdir)
+.endif
configure: configure.in
autoconf
@@ -133,6 +127,6 @@
@echo " "
@echo "The final archive is ./newt-$(VERSION).tar.gz."
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif
+.if exists(.depend)
+.include ".depend"
+.endif