1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00
freebsd-ports/net/tcpview/files/patch-Makefile
Cy Schubert bcee83e37b A quirky bug manifests itself when compiler optimisation is used, e.g.
when CFLAGS=-O is specified in make.conf, causing output that should be
displayed on the X display to be sent to stdout instead. This patch
forces compiler optimisation to be turned off allowing the port to work
as designed regardless of the optimisation specified in make.conf.
2006-05-12 23:05:58 +00:00

145 lines
4.5 KiB
Plaintext

--- Makefile.orig Thu Apr 22 23:40:24 1993
+++ Makefile Mon Feb 17 13:32:10 2003
@@ -28,10 +28,10 @@
#
# CSLIP and PPP work only under BPF.
#
-DEFINES =
-CCOPT = -O2
-INCLUDES = -I..
-LIB =
+DEFINES = -DCSLIP -DPPP
+CCOPT = -O0
+INCLUDES = -I.. -I$(X11BASE)/include
+LIB =-ll
# These are for the Sun4 version
#CCOPT = -O2 -Bstatic
@@ -41,20 +41,20 @@
XLIB= -lXm -lXt -lX11
# The installed binary is owned by this group.
-GROUP = staff
+GROUP = wheel
# Full pathname of where to install the binaries
-BINDEST = /usr/local/bin
-TCPSLICE_BINDEST = /usr/local/bin
+BINDEST = $(PREFIX)/bin
+TCPSLICE_BINDEST = $(PREFIX)/bin #unused (FreeBSD port)
# Full pathname of where to install tcpview support files
-TCPVIEW_DIR = /usr/local/tcpview
-FILTER_DIR = /usr/local/tcpview/filters
+TCPVIEW_DIR = $(PREFIX)/lib/tcpview
+FILTER_DIR = $(PREFIX)/lib/tcpview/filters
# Full pathname of where to install the manual entries
-TCPDUMP_MANDEST = /usr/man/manl/tcpdump.l
-TCPVIEW_MANDEST = /usr/man/manl/tcpview.l
-TCPSLICE_MANDEST = /usr/man/manl/tcpslice.l
+TCPDUMP_MANDEST = $(PREFIX)/man/man1/tcpdump.1
+TCPVIEW_MANDEST = $(PREFIX)/man/man1/tcpview.1
+TCPSLICE_MANDEST = $(PREFIX)/man/man1/tcpslice.1
# Standard CFLAGS
STANDARD_CFLAGS = $(CCOPT) $(DEFINES) $(INCLUDES)
@@ -70,7 +70,7 @@
#tahoe-bsd#CFLAGS = $(STANDARD_CFLAGS)
#vax-bsd#CFLAGS = $(STANDARD_CFLAGS)
#vax-ultrix#
-CFLAGS = $(STANDARD_CFLAGS)
+CFLAGS += $(STANDARD_CFLAGS)
#mips-irix#CFLAGS = $(STANDARD_CFLAGS) -D_BSD_COMPAT
SUBDIRS = hp300-bsd mips-ultrix sun?-sunos? sun4-bsd tahoe-bsd vax-bsd \
@@ -92,7 +92,8 @@
# Also, gcc does not remove the .o before forking 'as', which can be a
# problem if you don't own the file but can write to the directory.
.c.o:
- rm -f $@; $(CC) $(CFLAGS) -c $*.c
+# rm -f $@; $(CC) $(CFLAGS) -c $*.c
+ $(CC) $(CFLAGS) -c $*.c
# List all C source files here
@@ -189,7 +190,7 @@
$(CC) $(CFLAGS) -o $@ $(TCPDUMP_OBJ) $(LIB)
tcpview: $(TCPVIEW_OBJ)
- $(CC) $(CFLAGS) -o $@ $(TCPVIEW_OBJ) $(XLIB) $(LIB)
+ $(CC) $(CFLAGS) -o $@ $(TCPVIEW_OBJ) -L/usr/X11R6/lib $(XLIB) $(LIB)
tcpslice: $(TCPSLICE_OBJ)
$(CC) $(CFLAGS) -o $@ $(TCPSLICE_OBJ)
@@ -261,20 +262,21 @@
cd $$dir ; ${MAKE} ${MFLAGS} depend2
tcplex.c: tcplex.l
- rm -f $@
+# rm -f $@
$(LEX) $<
mv -f lex.yy.c tcplex.c
tokdefs.h: tcpgram.c
tcpgram.c: tcpgram.y
- rm -f tcpgram.c tokdefs.h
+# rm -f tcpgram.c tokdefs.h
$(YACC) -d $<
mv y.tab.c tcpgram.c
mv y.tab.h tokdefs.h
version.o: version.c
version.c version.h: VERSION TCPVIEW_VERSION
- rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c
+# rm -f version.c ;
+ sed 's/.*/char version[] = "&";/' VERSION > version.c
sed 's/.*/char tcpview_version[] = "&";/' TCPVIEW_VERSION >> version.c
set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \
{ echo '#define VERSION_MAJOR' $$1 ; \
@@ -287,22 +289,22 @@
install: force
-mkdir -p $(TCPVIEW_DIR)
-mkdir -p $(FILTER_DIR)
- @dir=$(MD)-$(OS)-tcpdump; set -x; \
- cd $$dir ; \
- install -m 755 -g $(GROUP) tcpdump $(DESTDIR)$(BINDEST); \
- install -m 755 tcpslice $(DESTDIR)$(TCPSLICE_BINDEST)
+# @dir=$(MD)-$(OS)-tcpdump; set -x; \
+# cd $$dir ; \
+# install -m 755 -g $(GROUP) -c tcpdump $(DESTDIR)$(BINDEST); \
+# install -m 755 -c tcpslice $(DESTDIR)$(TCPSLICE_BINDEST)
@dir=$(MD)-$(OS)-tcpview; set -x; \
cd $$dir ; \
- install -m 755 -g $(GROUP) tcpview $(DESTDIR)$(BINDEST); \
- install -m 755 -g $(GROUP) BGP $(FILTER_DIR); \
- install -m 755 -g $(GROUP) telnet $(FILTER_DIR); \
- install -m 755 -g $(GROUP) generic $(FILTER_DIR); \
+ ${BSD_INSTALL_PROGRAM} -c tcpview $(DESTDIR)$(BINDEST); \
+ ${BSD_INSTALL_PROGRAM} -c BGP $(FILTER_DIR); \
+ ${BSD_INSTALL_PROGRAM} -c telnet $(FILTER_DIR); \
+ ${BSD_INSTALL_PROGRAM} -c generic $(FILTER_DIR); \
cd ../DOC ; \
- install -m 666 -c hosts $(TCPVIEW_DIR); \
- install -m 666 -c manuf $(TCPVIEW_DIR); \
- install -c tcpdump.1 $(DESTDIR)$(TCPDUMP_MANDEST); \
- install -c tcpview.1 $(DESTDIR)$(TCPVIEW_MANDEST); \
- install -c tcpslice.1 $(DESTDIR)$(TCPSLICE_MANDEST)
+ ${BSD_INSTALL_DATA} -c hosts $(TCPVIEW_DIR); \
+ ${BSD_INSTALL_DATA} -c manuf $(TCPVIEW_DIR); \
+ ${BSD_INSTALL_MAN} -c tcpview.1 $(DESTDIR)$(TCPVIEW_MANDEST); \
+# install -m 444 -c tcpdump.1 $(DESTDIR)$(TCPDUMP_MANDEST); \
+# install -m 444 -c tcpslice.1 $(DESTDIR)$(TCPSLICE_MANDEST)
lint: force
lint -hbxn $(CSRC) | \
@@ -367,8 +369,3 @@
-../mkdep $(DEFINES) $(INCLUDES) $(TCPVIEW_CSRC) \
tcpgram.c tcplex.c
rm -f $(GEN)
-
-
-
-
-