Subject: Re: PLT2 problem
To: None <crusader@netbsd.hu>
From: Masao Uebayashi <uebayasi@pultek.co.jp>
List: tech-pkg
Date: 04/24/2003 11:26:59
----Next_Part(Thu_Apr_24_11:26:59_2003_989)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello.

Contrary to my previous comment that fixing PTL2 was hard, I now seem
to be able to fix the PTL2 configuration problem on -current.

Here is the package source and a patch to fix another Buildlink2 /
Autoconf problem, which may be incorporated into Pkgsrc soon.  This
patch was made by Lubomir Sedlacik.

Note that this is not tested at all yet.  I'd appreciate any feedback
from you. :)

Masao
----Next_Part(Thu_Apr_24_11:26:59_2003_989)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ptl2.work.shar"

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	ptl2.work
#	ptl2.work/Makefile
#	ptl2.work/DESCR
#	ptl2.work/distinfo
#	ptl2.work/PLIST
#	ptl2.work/patches
#	ptl2.work/patches/patch-ac
#	ptl2.work/patches/patch-aa
#	ptl2.work/patches/patch-ab
#	ptl2.work/patches/patch-ad
#	ptl2.work/patches/patch-ae
#	ptl2.work/patches/patch-af
#	ptl2.work/buildlink2.mk
#
echo c - ptl2.work
mkdir -p ptl2.work > /dev/null 2>&1
echo x - ptl2.work/Makefile
sed 's/^X//' >ptl2.work/Makefile << 'END-of-ptl2.work/Makefile'
X# $NetBSD: Makefile,v 1.41 2002/12/12 07:07:05 msaitoh Exp $
X
XDISTNAME=		PTL-2.1.9
XPKGNAME=		ptl-2.1.9
XCATEGORIES=		devel
XMASTER_SITES=		ftp://ftp.media.osaka-cu.ac.jp/pub/PTL/PTL2/
X
XPATCH_SITES=		${MASTER_SITES}
X
XMAINTAINER=		msaitoh@netbsd.org
XHOMEPAGE=		http://www.media.osaka-cu.ac.jp/~k-abe/PTL/
XCOMMENT=		Portable user-level Thread Library 2 written by Kota Abe
X
XUSE_BUILDLINK2=		YES
XUSE_PERL5=		build
XMAKE_ENV=		INSTALL_PROGRAM="${INSTALL_SCRIPT}"
XPLIST_SRC=		${WRKDIR}/PLIST
X
XAUTOCONF_REQD=		2.13
X
X# XXXuebayasi
X# Don't assume `siginfo' is a struct.  Our native one is a union!
X# XXX This is not enough to fix.
Xpost-patch:
X	@${GREP} -lr 'struct siginfo' ${WRKSRC} | \
X	while read f; do \
X		${CP} -p $$f $${f}.orig; \
X		${SED} 's|struct siginfo|siginfo_t|g' $${f}.orig >$$f; \
X	done
X
Xdo-configure:
X	@cd ${WRKSRC}; ${MAKE_PROGRAM} altsys
X
Xpost-install:
X	@${CHOWN} -R ${BINOWN}:${BINGRP} ${PREFIX}/PTL/include
X	@${FIND} ${PREFIX}/PTL/include -type f -name "*.orig" | ${XARGS} ${RM}
X	@${FIND} ${PREFIX}/PTL/include -type d -print | ${XARGS} ${CHMOD} 755
X	@${FIND} ${PREFIX}/PTL/include -type f -print | ${XARGS} ${CHMOD} 444
X	@${CP} ${PKGDIR}/PLIST ${PLIST_SRC}
X	@cd ${PREFIX}; \
X	${FIND} PTL -type f >>${PLIST_SRC}; \
X	for LINK in `${FIND} PTL -type l`; do \
X	  set - X `${FILE_CMD} $$LINK`; \
X	  ${ECHO} "@exec ${LN} -s $$6 %D/$$LINK" >>${PLIST_SRC}; \
X	  ${ECHO} "@unexec ${RM} -f %D/$$LINK" >>${PLIST_SRC}; \
X	done; \
X	for DIR in `${FIND} PTL -type d | sort -r`; do \
X	  if [ -z "`ls $$DIR`" ]; then \
X	    ${ECHO} "@exec ${MKDIR} %D/$$DIR" >>${PLIST_SRC}; \
X	  fi; \
X	  ${ECHO} "@dirrm $$DIR" >>${PLIST_SRC}; \
X	done
X
X.include "../../mk/autoconf.mk"
X.include "../../mk/automake.mk"
X.include "../../mk/bsd.pkg.mk"
END-of-ptl2.work/Makefile
echo x - ptl2.work/DESCR
sed 's/^X//' >ptl2.work/DESCR << 'END-of-ptl2.work/DESCR'
XThis is PTL2 -- Portable Thread Library 2 written by Kota Abe.
X
XThis library is based on the standard "POSIX 1003.1c" and works on BSD UNIX
X(architecture-independent!).
END-of-ptl2.work/DESCR
echo x - ptl2.work/distinfo
sed 's/^X//' >ptl2.work/distinfo << 'END-of-ptl2.work/distinfo'
X$NetBSD: distinfo,v 1.11 2002/12/12 07:07:05 msaitoh Exp $
X
XSHA1 (PTL-2.1.9.tar.gz) = 8ad35279a618f639d6fd0556c3053ca192ce50ee
XSize (PTL-2.1.9.tar.gz) = 694271 bytes
XSHA1 (patch-aa) = 0f59a555e41b660cf38521eead4b1c53d5df3138
XSHA1 (patch-ab) = 8b54f149324b09972cd85e3bd7581be3295631f2
XSHA1 (patch-ac) = 05f24a3521c2a79122ff027099911b1c98072727
XSHA1 (patch-ad) = e9104c77d3f860f371e0d1564addc3bf9871f1ca
XSHA1 (patch-ae) = 552856bfb8e86145074b9d80c46ee366232cbbb4
XSHA1 (patch-af) = c9957cab7f4576fe8ae183d4e53fc9fb8008d8dd
END-of-ptl2.work/distinfo
echo x - ptl2.work/PLIST
sed 's/^X//' >ptl2.work/PLIST << 'END-of-ptl2.work/PLIST'
X@comment $NetBSD: PLIST,v 1.2 2002/12/12 07:07:05 msaitoh Exp $
Xbin/ptlgcc
Xbin/ptlg++
Xlib/libPTL.a
Xlib/libPTL.so
Xlib/libPTL.so.2.1
END-of-ptl2.work/PLIST
echo c - ptl2.work/patches
mkdir -p ptl2.work/patches > /dev/null 2>&1
echo x - ptl2.work/patches/patch-ac
sed 's/^X//' >ptl2.work/patches/patch-ac << 'END-of-ptl2.work/patches/patch-ac'
X$NetBSD$
X
X+++ libaltsys/Makefile
X@@ -49,8 +49,8 @@
X 
X # BEGIN AUTOCONF
X utils/configure utils/config.h.in : utils/configure.in
X-	test -f $(AUTOCONFBINDIR)/autoconf && (cd utils; autoconf) || exit 0
X-	test -f $(AUTOCONFBINDIR)/autoheader &&	$(AUTOCONFBINDIR)/autoheader -l utils ./configure.in > utils/config.h.in || exit 0
X+	(cd utils; autoconf)
X+	$(AUTOCONFBINDIR)/autoheader -l utils ./configure.in > utils/config.h.in
X # END AUTOCONF
X 
X 
END-of-ptl2.work/patches/patch-ac
echo x - ptl2.work/patches/patch-aa
sed 's/^X//' >ptl2.work/patches/patch-aa << 'END-of-ptl2.work/patches/patch-aa'
X$NetBSD$
X
X+++ Makefile
X@@ -7,7 +7,7 @@
X #
X 
X # Install directory 
X-prefix = /usr/local
X+prefix = ${PREFIX}
X exec_prefix = $(prefix)
X 
X # Directory to install ptlgcc
X@@ -94,6 +94,6 @@
X 
X # BEGIN AUTOCONF
X Util/configure Util/config.h.in : Util/configure.in
X-	cd Util; test -f $(AUTOCONFBINDIR)/autoconf && autoconf || exit 0
X-	test -f $(AUTOCONFBINDIR)/autoheader && autoheader -l Util ./configure.in > Util/config.h.in || exit 0
X+	cd Util; autoconf
X+	autoheader -l Util ./configure.in > Util/config.h.in
X # END AUTOCONF
END-of-ptl2.work/patches/patch-aa
echo x - ptl2.work/patches/patch-ab
sed 's/^X//' >ptl2.work/patches/patch-ab << 'END-of-ptl2.work/patches/patch-ab'
X$NetBSD$
X
X+++ Util/Makefile.in
X@@ -293,7 +293,6 @@
X 	@echo "Loading $@ ... "
X 	$(MKSHLIBCMD) -o $@ $(LIBRARY_OBJS_PIC) $(LIBC_R_OBJS_PIC) $(NET_R_OBJS_PIC) $(altsysdir)/*.po
X 	-rm -f $(SHARED_LIBRARY)
X-	$(LN_S) $@ $(SHARED_LIBRARY)
X 	@echo done
X 
X # misc.c must be compiled without -O option
X@@ -323,13 +322,11 @@
X 
X # BEGIN AUTOCONF
X $(utildir)/configure: $(utildir)/configure.in
X-	test -f $(AUTOCONFBINDIR)/autoconf && \
X 	(cd $(utildir) ; autoconf) || exit 0
X 
X # autoheader might not change config.h.in, so touch a stamp file.
X $(utildir)/config.h.in: $(utildir)/stamp-h.in
X $(utildir)/stamp-h.in: configure.in acconfig.h
X-	test -f $(AUTOCONFBINDIR)/autoheader && \
X 	(cd $(utildir) ; autoheader configure.in > config.h.in) || exit 0
X 	date > $(utildir)/stamp-h.in
X # END AUTOCONF
END-of-ptl2.work/patches/patch-ab
echo x - ptl2.work/patches/patch-ad
sed 's/^X//' >ptl2.work/patches/patch-ad << 'END-of-ptl2.work/patches/patch-ad'
X$NetBSD$
X
X+++ Util/configure
X@@ -2384,7 +2384,7 @@
X 
X int main() {
X 
X-struct siginfo info;
X+siginfo_t info;
X 
X ; return 0; }
X EOF
END-of-ptl2.work/patches/patch-ad
echo x - ptl2.work/patches/patch-ae
sed 's/^X//' >ptl2.work/patches/patch-ae << 'END-of-ptl2.work/patches/patch-ae'
X$NetBSD$
X
X+++ src/inline.c
X@@ -354,9 +354,6 @@
X #ifdef SIGSET_T_LONG
X     *result = *set1 & *set2;
X #else
X-# ifdef __sigandset		/* linux */
X-    __sigandset(result, set1, set2);
X-# else
X     int sig;
X     if (result != set1) {
X 	*result = *set1;
X@@ -366,7 +363,6 @@
X 	    sigdelset(result, sig);
X 	}
X     }
X-# endif
X #endif
X }
X 
END-of-ptl2.work/patches/patch-ae
echo x - ptl2.work/patches/patch-af
sed 's/^X//' >ptl2.work/patches/patch-af << 'END-of-ptl2.work/patches/patch-af'
X$NetBSD$
X
X+++ src/signal_netbsd.c
X@@ -71,9 +71,15 @@
X     struct sigaction *sa;
X {
X 
X+#ifdef HAVE_SIGINFO
X+    sa->sa_handler = osa->osa_handler;
X+    native_sigset13_to_sigset(&osa->osa_mask, &sa->sa_mask);
X+    sa->sa_flags = osa->osa_flags;
X+#else
X     sa->sa_handler = osa->sa_handler;
X     native_sigset13_to_sigset(&osa->sa_mask, &sa->sa_mask);
X     sa->sa_flags = osa->sa_flags;
X+#endif
X }
X 
X void
X@@ -82,9 +88,15 @@
X     struct sigaction13 *osa;
X {
X 
X+#ifdef HAVE_SIGINFO
X+    osa->osa_handler = sa->sa_handler;
X+    native_sigset_to_sigset13(&sa->sa_mask, &osa->osa_mask);
X+    osa->osa_flags = sa->sa_flags;
X+#else
X     osa->sa_handler = sa->sa_handler;
X     native_sigset_to_sigset13(&sa->sa_mask, &osa->sa_mask);
X     osa->sa_flags = sa->sa_flags;
X+#endif
X }
X 
X extern int
END-of-ptl2.work/patches/patch-af
echo x - ptl2.work/buildlink2.mk
sed 's/^X//' >ptl2.work/buildlink2.mk << 'END-of-ptl2.work/buildlink2.mk'
X# $NetBSD: buildlink2.mk,v 1.3 2002/09/23 02:28:38 jlam Exp $
X
X.if !defined(PTL2_BUILDLINK2_MK)
XPTL2_BUILDLINK2_MK=	# defined
X
XBUILDLINK_PACKAGES+=		ptl2
XBUILDLINK_DEPENDS.ptl2?=	ptl>=2.1.7
XBUILDLINK_PKGSRCDIR.ptl2?=	../../devel/ptl2
X
XEVAL_PREFIX+=			BUILDLINK_PREFIX.ptl2=ptl
XBUILDLINK_PREFIX.ptl2_DEFAULT=	${LOCALBASE}
XBUILDLINK_FILES.ptl2=		PTL/include/*/*/*.h
XBUILDLINK_FILES.ptl2+=		PTL/include/*/*.h
XBUILDLINK_FILES.ptl2+=		PTL/include/*.h
XBUILDLINK_FILES.ptl2+=		lib/libPTL.*
X
XBUILDLINK_CPPFLAGS.ptl2=	-I${BUILDLINK_PREFIX.ptl2}/PTL/include
X
XBUILDLINK_TARGETS+=	ptl2-buildlink
X
Xptl2-buildlink: _BUILDLINK_USE
X
X.endif	# PTL2_BUILDLINK2_MK
END-of-ptl2.work/buildlink2.mk
exit


----Next_Part(Thu_Apr_24_11:26:59_2003_989)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="auto.diff"

Index: autoconf.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/autoconf.mk,v
retrieving revision 1.3
diff -u -r1.3 autoconf.mk
--- autoconf.mk	2002/10/03 19:36:36	1.3
+++ autoconf.mk	2003/04/23 15:50:04
@@ -12,6 +12,8 @@
 .if !defined(AUTOCONF_MK)
 AUTOCONF_MK=	# defined
 
+AUTOMAKE_OVERRIDE=	no
+
 # minimal required version
 AUTOCONF_REQD?= 2.50
 
Index: buildlink2/bsd.buildlink2.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/buildlink2/bsd.buildlink2.mk,v
retrieving revision 1.82
diff -u -r1.82 bsd.buildlink2.mk
--- buildlink2/bsd.buildlink2.mk	2003/04/15 01:35:59	1.82
+++ buildlink2/bsd.buildlink2.mk	2003/04/23 15:50:10
@@ -981,6 +981,9 @@
 # status for each of the GNU auto* tools, which should cause GNU configure
 # scripts to think that they can't be found.
 #
+# Create symbolic links in ${BUILDLINK_DIR} to real GNU auto* tools in case
+# autoconf.mk or automake.mk is included.
+#
 AUTOMAKE_OVERRIDE?=	yes
 _GNU_MISSING=		${.CURDIR}/../../mk/gnu-config/missing
 _HIDE_PROGS.autoconf=	bin/autoconf	bin/autoconf-2.13		\
@@ -998,23 +1001,50 @@
 					bin/automake-1.5		\
 					bin/automake-1.6		\
 					bin/automake-1.7
+_SHOW_PROGS.autoconf=	bin/autoconf					\
+			bin/autoheader					\
+			bin/autoreconf
+_SHOW_PROGS.automake=	bin/automake					\
+			bin/aclocal
 
 .if empty(AUTOMAKE_OVERRIDE:M[nN][oO])
 do-buildlink: hide-autotools
-.endif
 
 hide-autotools:	# empty
 
-.for _autotool_ in autoconf automake
+.	for _autotool_ in autoconf automake
 hide-autotools: hide-${_autotool_}
-.  for _prog_ in ${_HIDE_PROGS.${_autotool_}}
+.	  for _prog_ in ${_HIDE_PROGS.${_autotool_}}
 hide-${_autotool_}: ${BUILDLINK_DIR}/${_prog_}
 ${BUILDLINK_DIR}/${_prog_}: ${_GNU_MISSING}
-	${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
-	${_PKG_SILENT}${_PKG_DEBUG}					\
-	${ECHO} "#!${BUILDLINK_SHELL}" > ${.TARGET}
-	${_PKG_SILENT}${_PKG_DEBUG}					\
-	${ECHO} "exec ${_GNU_MISSING} ${_prog_:T:C/-[0-9].*$//}" >> ${.TARGET}
-	${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
-.  endfor
-.endfor
+		${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+		${_PKG_SILENT}${_PKG_DEBUG}				\
+		${ECHO} "#!${BUILDLINK_SHELL}" > ${.TARGET}
+		${_PKG_SILENT}${_PKG_DEBUG}				\
+		${ECHO} "exec ${_GNU_MISSING} ${_prog_:T:C/-[0-9].*$//}" >> ${.TARGET}
+		${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
+.	  endfor
+.	endfor
+
+.else if defined(AUTOCONF_MK)
+do-buildlink: show-autotools
+
+show-autotools: # empty
+
+_autotools_=	autoconf
+.	if defined(AUTOMAKE_MK)
+_autotools_+=	automake
+.	endif
+
+.	for _autotool_ in ${_autotools_}
+show-autotools: show-${_autotool_}
+.	  for _prog_ in ${_SHOW_PROGS.${_autotool_}}
+show-${_autotool_}: ${BUILDLINK_DIR}/${_prog_}
+${BUILDLINK_DIR}/${_prog_}: ${${_prog_:S/bin\///:tu}}
+		${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+		${_PKG_SILENT}${_PKG_DEBUG}					\
+		${LN} -s ${${_prog_:S/bin\///:tu}} ${.TARGET}
+.	  endfor
+.	endfor
+
+.endif

----Next_Part(Thu_Apr_24_11:26:59_2003_989)----