pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/procmail Teach procmail to cross-compile on NetBSD.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4bf6bbf71c7b
branches:  trunk
changeset: 398061:4bf6bbf71c7b
user:      riastradh <riastradh%pkgsrc.org@localhost>
date:      Tue Jul 09 15:46:42 2019 +0000

description:
Teach procmail to cross-compile on NetBSD.

No revbump because this was not cross-compilable before.

diffstat:

 mail/procmail/Makefile                     |  15 ++++++++++-
 mail/procmail/distinfo                     |   4 ++-
 mail/procmail/files/autoconf-NetBSD.h.in   |  28 +++++++++++++++++++++
 mail/procmail/patches/patch-Makefile       |  14 ++++++++++
 mail/procmail/patches/patch-src_Makefile.0 |  39 ++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 2 deletions(-)

diffs (137 lines):

diff -r 03e929f7d40f -r 4bf6bbf71c7b mail/procmail/Makefile
--- a/mail/procmail/Makefile    Tue Jul 09 15:46:10 2019 +0000
+++ b/mail/procmail/Makefile    Tue Jul 09 15:46:42 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.50 2017/11/26 20:39:40 snj Exp $
+# $NetBSD: Makefile,v 1.51 2019/07/09 15:46:42 riastradh Exp $
 
 DISTNAME=      procmail-3.22
 PKGREVISION=   5
@@ -45,6 +45,19 @@
        >> ${WRKSRC}/src/authenticate.h
 .endif
 
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+MAKE_FLAGS+=   CC_FOR_BUILD=${NATIVE_CC:Q}
+
+.if exists(${FILESDIR}/autoconf-${OPSYS}.h.in)
+post-configure:
+       cd ${WRKSRC} && ${MAKE} init
+       ${SED} -e s,@PREFIX@,${PREFIX:U},g                              \
+               -e s,@PKGVERSION@,${PKGVERSION:U},g                     \
+           < ${FILESDIR}/autoconf-${OPSYS}.h.in                        \
+           > ${WRKSRC}/autoconf.h
+.endif
+.endif
+
 .if ${OPSYS} == "SunOS"
 do-install:
        cd ${WRKSRC}/new;                                               \
diff -r 03e929f7d40f -r 4bf6bbf71c7b mail/procmail/distinfo
--- a/mail/procmail/distinfo    Tue Jul 09 15:46:10 2019 +0000
+++ b/mail/procmail/distinfo    Tue Jul 09 15:46:42 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2017/11/26 20:39:40 snj Exp $
+$NetBSD: distinfo,v 1.18 2019/07/09 15:46:42 riastradh Exp $
 
 SHA1 (procmail-3.22.tar.gz) = cd4e44c15559816453fd60349e5a32289f6f2965
 RMD160 (procmail-3.22.tar.gz) = e609ec94ea9ab3b93629c62b3e29add497806483
@@ -15,3 +15,5 @@
 SHA1 (patch-bb) = 5b273bd60d24168794189bb844e39e94bd688ea8
 SHA1 (patch-bc) = 7344d3c2fce1bcd3276d8e5014bf9537c6dece5c
 SHA1 (patch-bd) = 27a7711e400f934bc82937eae68681e0b5c30c4a
+SHA1 (patch-Makefile) = d37a6b8d7769bd98efeca3abb7d52b12873971c0
+SHA1 (patch-src_Makefile.0) = 9136b5f011456cba313d1a4884144e881974261d
diff -r 03e929f7d40f -r 4bf6bbf71c7b mail/procmail/files/autoconf-NetBSD.h.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/procmail/files/autoconf-NetBSD.h.in  Tue Jul 09 15:46:42 2019 +0000
@@ -0,0 +1,28 @@
+/* This file was automagically generated by autoconf */
+
+/* 65 moves in 64 steps of size 16384 when reallocing */
+#define INEFFICIENTrealloc
+#define NOsetrgid
+#define GOT_bin_test
+#define MAX_argc 15300
+/* Your system's strstr() is 1.91 times SLOWER than my C-routine */
+#define SLOWstrstr                           /* using my substitute instead */
+#define UDP_protocolno 17
+#define BIFF_serviceport "512"
+#define IP_localhost {127,0,0,1}
+#define MAILSPOOLDIR "/var/mail/"
+#define SENDMAIL "/usr/sbin/sendmail"
+#define CF_no_procmail_yet
+#define buggy_SENDMAIL
+#define defPATH "PATH=$HOME/bin:/bin:/usr/bin:@PREFIX@/bin:/usr/X11R7/bin"
+#define defSPATH "PATH=/bin:/usr/bin:@PREFIX@/bin:/usr/X11R7/bin"
+#define PM_VERSION "@PKGVERSION@"
+/*locktype: 4, countlocks: 80, timeout 0, watchdog 14, /tmp/_locktest*/
+/*locktype: 2, countlocks: 0, timeout 0, watchdog 8, /tmp/_locktest*/
+/*locktype: 2, countlocks: 0, timeout 0, watchdog 8, ./_locktest*/
+/*locktype: 3, countlocks: 80, timeout 0, watchdog 14, /tmp/_locktest*/
+/* Hotwire LOCKINGTEST=010 */
+/* Procmail will lock via: dotlocking, lockf() */
+#define NOfcntl_lock
+#define USElockf
+/* autoconf completed */
diff -r 03e929f7d40f -r 4bf6bbf71c7b mail/procmail/patches/patch-Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/procmail/patches/patch-Makefile      Tue Jul 09 15:46:42 2019 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-Makefile,v 1.1 2019/07/09 15:46:42 riastradh Exp $
+
+Define CC_FOR_BUILD so we can use it even when not cross-compiling.
+
+--- Makefile.orig      2019-07-08 17:03:10.000000000 +0000
++++ Makefile
+@@ -95,6 +95,7 @@ CFLAGS1 = $(CFLAGS0) #-posix -Xp
+ LDFLAGS1= $(LDFLAGS0) $(LIBS) #-lcposix
+ 
+ ####CC        = cc # gcc
++CC_FOR_BUILD = $(CC)
+ # object file extension
+ O     = o
+ RM    = /bin/rm -f
diff -r 03e929f7d40f -r 4bf6bbf71c7b mail/procmail/patches/patch-src_Makefile.0
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/procmail/patches/patch-src_Makefile.0        Tue Jul 09 15:46:42 2019 +0000
@@ -0,0 +1,39 @@
+$NetBSD: patch-src_Makefile.0,v 1.1 2019/07/09 15:46:42 riastradh Exp $
+
+Compile recommend with CC_FOR_BUILD since it is executed during build.
+
+--- src/Makefile.0.orig        2001-06-29 02:20:35.000000000 +0000
++++ src/Makefile.0
+@@ -156,11 +156,15 @@ setid.$(O): setid.c
+       @$(CC) -c $(CFLAGS) $*.c
+ 
+ recommend.$(O): recommend.c
+-      @$(CC) -c $(CFLAGS) $*.c
++      @$(CC_FOR_BUILD) -c $(CFLAGS) $*.c
+ 
+ .c.$(O):
+       $(CC) -c $(CFLAGS) $<
+ 
++.SUFFIXES: .host-$(O)
++.c.host-$(O):
++      $(CC_FOR_BUILD) -c -o $@ $(CFLAGS) $<
++
+ gethome: gethome.$(O) setid
+       @$(CC) $(CFLAGS) $@.$(O) -o $@ $(LDFLAGS)
+ 
+@@ -170,12 +174,12 @@ getparams:
+ setid: setid.$(O)
+       @$(CC) $(CFLAGS) $@.$(O) -o $@ $(LDFLAGS)
+ 
+-recommend: recommend.$(O) sublib.$(O)
+-      @$(CC) $(CFLAGS) $@.$(O) sublib.$(O) -o $@ $(LDFLAGS)
++recommend: recommend.$(O) sublib.host-$(O)
++      @$(CC_FOR_BUILD) $(CFLAGS) $@.$(O) sublib.host-$(O) -o $@ $(LDFLAGS)
+ 
+ ../man/man.sed: manconf.c ../autoconf.h ../config.h includes.h procmail.h
+ ../man/man.sed: ../patchlevel.h
+-      @$(CC) $(CFLAGS) "-DBINDIR=\"$(VISIBLE_BINDIR)\"" -o _autotst \
++      @$(CC_FOR_BUILD) $(CFLAGS) "-DBINDIR=\"$(VISIBLE_BINDIR)\"" -o _autotst \
+  manconf.c $(LDFLAGS)
+       @./_autotst $@
+       @echo Housekeeping file >$@



Home | Main Index | Thread Index | Old Index