1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
--- src/osdep/unix/Makefile.orig Thu Apr 21 00:48:34 2005
+++ src/osdep/unix/Makefile Mon May 30 19:08:25 2005
@@ -22,8 +22,8 @@
EXTRAAUTHENTICATORS=
EXTRADRIVERS=mbox
-PASSWDTYPE=std
-SSLTYPE=nopwd
+PASSWDTYPE=pam
+SSLTYPE=unix.nopwd
IP=4
@@ -41,13 +41,13 @@
# Extended flags needed for SSL. You may need to modify.
-SSLDIR=/usr/local/ssl
-SSLCERTS=$(SSLDIR)/certs
+SSLDIR=$(OPENSSLBASE)
+SSLCERTS=$(PREFIX)/certs
SSLKEYS=$(SSLCERTS)
-SSLINCLUDE=$(SSLDIR)/include
-SSLLIB=$(SSLDIR)/lib
+SSLINCLUDE=$(OPENSSLINC)
+SSLLIB=$(OPENSSLLIB)
-SSLCRYPTO=-lcrypto
+SSLCRYPTO=-lcrypto -lcrypt
# Older versions of MIT Kerberos also have a libcrypto. If so, you may need
# to use this instead
@@ -74,7 +74,7 @@
# AFSLDFLAGS may also need -L/usr/ucblib -lucb
DCECFLAGS= -DDCE_MINIMAL -DPASSWD_OVERRIDE=\"/opt/pop3/passwd/passwd\"
DCELDFLAGS= -ldce
-PAMLDFLAGS= -lpam -ldl
+PAMLDFLAGS= # -lpam -lcrypt
# Build parameters normally set by the individual port
@@ -111,7 +111,7 @@
# Commands possibly overriden by the individual port
ARRC=ar rc
-CC=cc
+#CC=cc
LN=ln -s
RANLIB=ranlib
@@ -129,7 +129,7 @@
dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o
-CFLAGS=-g
+CFLAGS+=$(BASECFLAGS) $(EXTRACFLAGS)
CAT=cat
MAKE=make
@@ -146,6 +146,10 @@
PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP)
+# Need this for the shared library rule to work correctly
+.SUFFIXES: .o .so
+SOFILES=${BINARIES:.o=.so}
+
# Here if no make argument established
missing: osdep.h
@@ -226,13 +230,14 @@
BASECFLAGS="-g -Dconst="
bsf: # FreeBSD
- $(BUILD) `$(CAT) SPECIALS` OS=$@ \
+ $(BUILD) `$(CAT) SPECIALS` OS=$@ CHECKPW=pam \
SIGTYPE=psx CRXTYPE=nfs \
SPOOLDIR=/var \
ACTIVEFILE=/usr/local/news/lib/active \
RSHPATH=/usr/bin/rsh \
- BASECFLAGS="-g -O -pipe" \
- BASELDFLAGS="-lcrypt"
+ LOCKPGM=$(PREFIX)/libexec/mlock \
+ BASECFLAGS="-DNFSKLUDGE" \
+ BASELDFLAGS="-lpam"
bsi: # BSD/i386
$(BUILD) `$(CAT) SPECIALS` OS=$@ \
@@ -801,23 +806,35 @@
# Build it!
-build: clean once $(ARCHIVE)
+build: clean once $(ARCHIVE) $(SHLIBNAME)
-all: $(ARCHIVE)
+all: $(ARCHIVE) $(SHLIBNAME)
$(ARCHIVE): $(BINARIES)
sh -c '$(RM) $(ARCHIVE) || true'
@$(CAT) ARCHIVE
@$(SH) ARCHIVE
+$(SHLIBNAME): $(SOFILES)
+.if $(PORTOBJFORMAT) == "elf"
+ ld -shared -x -soname $(SHLIBNAME) -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS`
+.else
+ ld -Bshareable -x -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS`
+.endif
+ ln -s $(SHLIBNAME) lib$(SHLIBBASE).so
+
+.c.so: osdep.h
+ $(CC) -fPIC -DPIC -c $(CFLAGS) ${@:.so=.c} -o $@
+
.c.o:
- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
+ $(CC) -c $(CFLAGS) $*.c
# Cleanup
clean:
sh -c '$(RM) auths.c crexcl.c nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
+ sh -c '$(RM) *.so $(SHLIBNAME)'
# Dependencies
@@ -850,7 +867,7 @@
# OS-dependent
-osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
+OSDEPS= mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
osdep.h env_unix.h tcp_unix.h \
osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c ip_unix.c\
auths.c crexcl.c flockcyg.c flocklnx.c flocksim.c nfstest.c fsync.c \
@@ -864,12 +881,19 @@
write.c sslstdio.c \
strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
OSCFLAGS
+
+osdep.o: $(OSDEPS)
+ $(CC) $(CFLAGS) `$(CAT) OSCFLAGS` -c osdep.c
+ @echo ========================================================================
@echo Building OS-dependent module
@echo If you get No such file error messages for files x509.h, ssl.h,
@echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
@echo is not installed on your system. Either install OpenSSL first
@echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none
- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
+ @echo ========================================================================
+
+osdep.so: $(OSDEPS)
+ $(CC) -fPIC -DPIC -c $(CFLAGS) `cat OSCFLAGS` osdep.c -o $@
osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
$(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
|