openbsd-ports/mail/c-client/patches/patch-src_osdep_unix_Makefile
2000-09-15 09:44:12 +00:00

77 lines
1.9 KiB
Plaintext

--- src/osdep/unix/Makefile.orig Tue Nov 16 21:05:48 1999
+++ src/osdep/unix/Makefile Fri Sep 15 04:26:14 2000
@@ -96,6 +96,7 @@
DEFAULTAUTHENTICATORS=md5 $(SPECIALAUTHENTICATORS) 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
@@ -104,6 +105,7 @@
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=$(BASECFLAGS) $(EXTRACFLAGS)
MAKE=make
MV=mv
@@ -627,20 +629,27 @@
# 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 -o $(SHLIB) $(SOBINARIES)
+
# Cleanup
clean:
sh -c '$(RM) auths.c flockbsd.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
-
+ $(RM) *.so $(SHLIB)
# Dependencies
@@ -673,7 +682,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 \
auths.c flock.c flockbsd.c flcksafe.c fsync.c gethstid.c \
@@ -685,10 +694,18 @@
write.c \
strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
OSCFLAGS
+
+osdep.o: $(OSDEPS)
$(CC) $(CFLAGS) `cat OSCFLAGS` -c osdep.c
+osdep.so: $(OSDEPS)
+ $(CC) $(CFLAGS) `cat OSCFLAGS` -fpic -DPIC -c osdep.c -o $@
+
osdep.c: osdepbas.c osdepckp.c osdeplog.c
cat osdepbas.c osdepckp.c osdeplog.c > osdep.c
+
+.c.so: osdep.h
+ $(CC) $(CFLAGS) -fpic -DPIC -c $(@:.so=.c) -o $@
flockbsd.c: # cretin Linux