137 lines
4.1 KiB
Plaintext
137 lines
4.1 KiB
Plaintext
$OpenBSD: patch-src_osdep_unix_Makefile,v 1.11 2011/11/06 09:03:28 ajacoutot Exp $
|
|
|
|
--- src/osdep/unix/Makefile.orig Sat Jul 23 02:20:10 2011
|
|
+++ src/osdep/unix/Makefile Sun Nov 6 09:59:50 2011
|
|
@@ -42,7 +42,7 @@ IP=4
|
|
# -O3 seems to be safe, but empirical observation from our local expert
|
|
# indicates that in some (many?) cases -O3 code runs slower than -O2.
|
|
|
|
-GCCOPTLEVEL= -O2
|
|
+GCCOPTLEVEL=
|
|
|
|
|
|
# Try to have some consistency in GCC builds. We want optimization, but we
|
|
@@ -54,9 +54,9 @@ GCC4CFLAGS= $(GCCCFLAGS) -Wno-pointer-sign
|
|
|
|
# Extended flags needed for SSL. You may need to modify.
|
|
|
|
-SSLDIR=/usr/local/ssl
|
|
-SSLCERTS=$(SSLDIR)/certs
|
|
-SSLKEYS=$(SSLCERTS)
|
|
+SSLDIR=/usr
|
|
+SSLCERTS=/etc/ssl
|
|
+SSLKEYS=$(SSLCERTS)/private
|
|
SSLINCLUDE=$(SSLDIR)/include
|
|
SSLLIB=$(SSLDIR)/lib
|
|
|
|
@@ -82,7 +82,7 @@ AFSDIR=/usr/afsws
|
|
AFSCFLAGS=-I$(AFSDIR)/include
|
|
AFSLIB=$(AFSDIR)/lib
|
|
AFSLDFLAGS=-L$(AFSLIB)/afs -L$(AFSLIB) -L$(AFSDIR)/domestic/lib\
|
|
- -lkauth -lprot -lubik -lauth -lrxkad -lrx -llwp -ldes -lcom_err\
|
|
+ -lkauth -lprot -lubik -lauth -lrxkad -lrx -llwp -lcom_err\
|
|
$(AFSLIB)/afs/util.a -laudit -lsys
|
|
# AFSLDFLAGS may also need -L/usr/ucblib -lucb
|
|
DCECFLAGS= -DDCE_MINIMAL -DPASSWD_OVERRIDE=\"/opt/pop3/passwd/passwd\"
|
|
@@ -147,6 +147,8 @@ DEFAULTAUTHENTICATORS=ext md5 pla log
|
|
DEFAULTDRIVERS=imap nntp pop3 mix mx mbx tenex mtx mh mmdf unix news phile
|
|
CHUNKSIZE=65536
|
|
|
|
+.SUFFIXES: .o .so
|
|
+
|
|
# Normally no need to change any of these
|
|
|
|
ARCHIVE=c-client.a
|
|
@@ -154,6 +156,7 @@ BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf
|
|
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 mix.o
|
|
+SOBINARIES=$(BINARIES:.o=.so)
|
|
CFLAGS=-g
|
|
|
|
CAT=cat
|
|
@@ -162,6 +165,11 @@ MV=mv
|
|
RM=rm -rf
|
|
SH=sh
|
|
|
|
+.if ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "sparc"
|
|
+PICFLAG= -fPIC
|
|
+.else
|
|
+PICFLAG= -fpic
|
|
+.endif
|
|
|
|
# Primary build command
|
|
|
|
@@ -281,6 +289,7 @@ bso: # OpenBSD
|
|
SPOOLDIR=/var \
|
|
ACTIVEFILE=/usr/local/news/lib/active \
|
|
RSHPATH=/usr/bin/rsh \
|
|
+ LOCKPGM=$(PREFIX)/libexec/mlock \
|
|
BASECFLAGS="$(GCCCFLAGS)"
|
|
|
|
cvx: # Convex
|
|
@@ -853,23 +862,33 @@ vu2: # VAX Ultrix 2.3, etc.
|
|
|
|
# Build it!
|
|
|
|
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
|
|
build: clean once $(ARCHIVE)
|
|
-
|
|
all: $(ARCHIVE)
|
|
+.else
|
|
+build: clean once $(ARCHIVE) $(SHLIB)
|
|
+all: $(ARCHIVE) $(SHLIB)
|
|
+.endif
|
|
|
|
$(ARCHIVE): $(BINARIES)
|
|
sh -c '$(RM) $(ARCHIVE) || true'
|
|
@$(CAT) ARCHIVE
|
|
@$(SH) ARCHIVE
|
|
|
|
+$(SHLIB): $(SOBINARIES)
|
|
+ $(CC) -shared $(PICFLAG) -o $(SHLIB) $(SOBINARIES)
|
|
+
|
|
+
|
|
.c.o:
|
|
`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
|
|
|
|
+.c.so:
|
|
+ `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $(PICFLAG) -DPIC $(@:.so=.c) -o $@
|
|
|
|
# Cleanup
|
|
|
|
clean:
|
|
- sh -c '$(RM) auths.c crexcl.c ip_unix.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
|
|
+ sh -c '$(RM) auths.c crexcl.c linkage.[ch] siglocal.c osdep*.[ch] *.o *.so ARCHIVE *FLAGS *TYPE $(ARCHIVE) $(SHLIB) || true'
|
|
|
|
|
|
# Dependencies
|
|
@@ -904,7 +923,7 @@ utf8aux.o: mail.h misc.h osdep.h utf8.h
|
|
|
|
# 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 fsync.c \
|
|
@@ -918,12 +937,12 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
|
|
write.c sslstdio.c \
|
|
strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
|
|
OSCFLAGS
|
|
- @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
|
|
+
|
|
+osdep.o: $(OSDEPS)
|
|
+ `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` osdep.c
|
|
+
|
|
+osdep.so: $(OSDEPS)
|
|
+ `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` $(PICFLAG) -DPIC osdep.c -o $@
|
|
|
|
osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
|
|
$(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
|