openbsd-ports/mail/c-client/patches/patch-src_osdep_unix_Makefile
2004-04-02 08:18:48 +00:00

116 lines
3.3 KiB
Plaintext

$OpenBSD: patch-src_osdep_unix_Makefile,v 1.11 2004/04/02 08:18:48 jakob Exp $
--- src/osdep/unix/Makefile.orig 2003-07-15 03:35:30.000000000 +0200
+++ src/osdep/unix/Makefile 2004-04-02 09:58:52.000000000 +0200
@@ -28,8 +28,8 @@ SSLTYPE=nopwd
# Extended flags needed for SSL. You may need to modify.
-SSLDIR=/usr/local/ssl
-SSLCERTS=$(SSLDIR)/certs
+SSLDIR=/usr
+SSLCERTS=/etc/ssl
SSLKEYS=$(SSLCERTS)
SSLINCLUDE=$(SSLDIR)/include
SSLLIB=$(SSLDIR)/lib
@@ -108,6 +108,7 @@ RANLIB=ranlib
DEFAULTAUTHENTICATORS=md5 pla log
DEFAULTDRIVERS=imap nntp pop3 mh mx mbx tenex mtx mmdf unix news phile
+.SUFFIXES: .o .so
# Normally no need to change any of these
@@ -116,6 +117,7 @@ BINARIES=osdep.o mail.o misc.o newsrc.o
dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
unix.o mbox.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o
+SOBINARIES=$(BINARIES:.o=.so)
CFLAGS=-g
CAT=cat
@@ -124,6 +126,11 @@ MV=mv
RM=rm -rf
SH=sh
+.if ${MACHINE_ARCH} == "sparc64"
+PICFLAG= -fPIC
+.else
+PICFLAG= -fpic
+.endif
# Primary build command
@@ -235,7 +242,7 @@ bso: # OpenBSD
SPOOLDIR=/var \
ACTIVEFILE=/usr/local/news/lib/active \
RSHPATH=/usr/bin/rsh \
- BASECFLAGS="-O2 -pipe"
+ BASECFLAGS="-pipe"
cvx: # Convex
$(BUILD) `$(CAT) SPECIALS` OS=$@ \
@@ -763,23 +770,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 nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
+ sh -c '$(RM) auths.c crexcl.c nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o *.so ARCHIVE *FLAGS *TYPE $(ARCHIVE) $(SHLIB) || true'
# Dependencies
@@ -813,7 +830,7 @@ utf8.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 \
auths.c crexcl.c flocksim.c nfstest.c flcksafe.c fsync.c gethstid.c \
@@ -826,12 +843,12 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h n
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