]> git.wh0rd.org - patches.git/blob - portmap-build-cleanup.patch
more random patches. who knows.
[patches.git] / portmap-build-cleanup.patch
1 diff --git a/Makefile b/Makefile
2 index 7131fc8..1376ea7 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -7,7 +7,7 @@
6 # sendmail transaction logs. Change the definition of the following macro
7 # if you disagree. See `man 3 syslog' for examples. Some syslog versions
8 # do not provide this flexibility.
9 -#
10 +
11 FACILITY=LOG_DAEMON
12
13 # To disable tcp-wrapper style access control, comment out the following
14 @@ -15,8 +15,10 @@ FACILITY=LOG_DAEMON
15 # no access control tables. The local system, since it runs the portmap
16 # daemon, is always treated as an authorized host.
17
18 -HOSTS_ACCESS= -DHOSTS_ACCESS
19 -WRAP_LIB = -lwrap
20 +ifeq ($(NO_TCP_WRAPPER),)
21 +CPPFLAGS += -DHOSTS_ACCESS
22 +WRAP_LIB = -lwrap
23 +endif
24
25 # Comment out if your RPC library does not allocate privileged ports for
26 # requests from processes with root privilege, or the new portmap will
27 @@ -24,7 +26,7 @@ WRAP_LIB = -lwrap
28 # ports. You can find out by running "rpcinfo -p"; if all mountd and NIS
29 # daemons use a port >= 1024 you should probably disable the next line.
30
31 -CHECK_PORT = -DCHECK_PORT
32 +CPPFLAGS += -DCHECK_PORT
33
34 # Warning: troublesome feature ahead!! Enable only when you are really
35 # desperate!!
36 @@ -59,63 +61,52 @@ CHECK_PORT = -DCHECK_PORT
37 # probably much easier to just block port UDP and TCP ports 111 on
38 # your routers.
39 #
40 -# LOOPBACK = -DLOOPBACK_SETUNSET
41 +# CPPFLAGS += -DLOOPBACK_SETUNSET
42
43 # When the portmapper cannot find any local interfaces (it will complain
44 # to the syslog daemon) your system probably has variable-length socket
45 # address structures (struct sockaddr has a sa_len component; examples:
46 # AIX 4.1 and 4.4BSD). Uncomment next macro definition in that case.
47 #
48 -# SA_LEN = -DHAS_SA_LEN # AIX 4.x, BSD 4.4, FreeBSD, NetBSD
49 +# CPPFLAGS += -DHAS_SA_LEN # AIX 4.x, BSD 4.4, FreeBSD, NetBSD
50
51 # With verbose logging on, HP-UX 9.x and AIX 4.1 leave zombies behind when
52 # SIGCHLD is not ignored. Enable next macro for a fix.
53 #
54 -ZOMBIES = -DIGNORE_SIGCHLD # AIX 4.x, HP-UX 9.x
55 +CPPFLAGS += -DIGNORE_SIGCHLD # AIX 4.x, HP-UX 9.x
56
57 # Uncomment the following macro if your system does not have u_long.
58 #
59 -# ULONG =-Du_long="unsigned long"
60 +# CPPFLAGS +=-Du_long="unsigned long"
61
62 #
63 -# LIBS = -m
64 -# NSARCHS = -arch m68k -arch i386 -arch hppa
65 +# LDLIBS += -m
66 +# CFLAGS += -arch m68k -arch i386 -arch hppa
67
68 # Auxiliary libraries that you may have to specify
69 #
70 -# LIBS = -lrpc
71 +# LDLIBS += -lrpc
72
73 # Comment out if your compiler talks ANSI and understands const
74 #
75 -# CONST = -Dconst=
76 +# CPPFLAGS += -Dconst=
77
78 ### End of configurable stuff.
79 ##############################
80
81 -SHELL = /bin/sh
82 -
83 -RPM_OPT_FLAGS = -O2
84 -
85 -COPT = $(CONST) $(HOSTS_ACCESS) $(CHECK_PORT) \
86 - $(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN) \
87 - $(LOOPBACK)
88 -CFLAGS = $(COPT) $(RPM_OPT_FLAGS) $(NSARCHS) -Wall -Wstrict-prototypes \
89 - -fpie
90 -OBJECTS = portmap.o pmap_check.o from_local.o
91 +CPPFLAGS += -DFACILITY=$(FACILITY)
92 +CFLAGS ?= -O2
93 +CFLAGS += -Wall -Wstrict-prototypes
94
95 all: portmap pmap_dump pmap_set
96
97 -portmap: $(OBJECTS)
98 - $(CC) $(CFLAGS) -pie -o $@ $(OBJECTS) $(WRAP_LIB) $(LIBS)
99 +CPPFLAGS += $(HOSTS_ACCESS)
100 +portmap: CFLAGS += -fpie
101 +portmap: LDLIBS += $(WRAP_LIB)
102 +portmap: LDFLAGS += -pie
103 +portmap: portmap.o pmap_check.o from_local.o
104
105 -pmap_dump: pmap_dump.c
106 - $(CC) $(CFLAGS) -o $@ $? $(LIBS)
107 -
108 -pmap_set: pmap_set.c
109 - $(CC) $(CFLAGS) -o $@ $? $(LIBS)
110 -
111 -from_local: from_local.c
112 - cc $(CFLAGS) -DTEST -o $@ from_local.c
113 +from_local: CPPFLAGS += -DTEST
114
115 install: all
116 install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
117 @@ -125,23 +116,12 @@ install: all
118 install -o root -g root -m 0644 pmap_dump.8 ${BASEDIR}/usr/share/man/man8
119 install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
120
121 -lint:
122 - lint $(COPT) $(OBJECTS:%.o=%.c)
123 -
124 clean:
125 rm -f *.o portmap pmap_dump pmap_set from_local \
126 core
127
128 -tidy: clean
129 - chmod 755 . ; chmod -R a+r .
130 -
131 -deps:
132 - @$(CC) -M $(CFLAGS) *.c | grep -v /usr/include |sed 's/\.\///'
133 +-include .depend
134 +.depend: *.c
135 + $(CC) -MM $(CFLAGS) *.c > .depend
136
137 -from_local.o: from_local.c
138 -pmap_check.o: pmap_check.c
139 -pmap_check.o: pmap_check.h Makefile
140 -pmap_dump.o: pmap_dump.c
141 -pmap_set.o: pmap_set.c
142 -portmap.o: portmap.c
143 -portmap.o: pmap_check.h Makefile
144 +.PHONY: all clean install