From owner-ports-jp@jp.FreeBSD.org Sat Jan 26 04:03:11 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g0PJ3B428344;
	Sat, 26 Jan 2002 04:03:11 +0900 (JST)
	(envelope-from owner-ports-jp@jp.FreeBSD.org)
Received: from sv01.geocities.co.jp (sv01.geocities.co.jp [210.153.89.155])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g0PJ3B628339
	for <ports-jp@jp.FreeBSD.org>; Sat, 26 Jan 2002 04:03:11 +0900 (JST)
	(envelope-from dai_fugo@geocities.co.jp)
Received: from mail.geocities.co.jp (mail.geocities.co.jp [210.153.89.137]) by sv01.geocities.co.jp (8.9.3+3.2W/3.7W) with ESMTP id EAA09822 for <ports-jp@jp.FreeBSD.org>; Sat, 26 Jan 2002 04:03:09 +0900 (JST)
Received: from localhost.localdomain (socigeog.hmt.toyama-u.ac.jp [160.26.63.48]) by mail.geocities.co.jp (1.3G-GeocitiesJ-3.3) with SMTP id EAA24639 for <ports-jp@jp.FreeBSD.org>; Sat, 26 Jan 2002 04:02:25 +0900 (JST)
Date: Sat, 26 Jan 2002 04:02:33 +0900
From: KATO Tsuguru <dai_fugo@geocities.co.jp>
To: ports-jp@jp.FreeBSD.org
Message-Id: <20020126040233.2ada7a69.dai_fugo@geocities.co.jp>
X-Mailer: Sylpheed version 0.7.0 (GTK+ 1.2.10; i386--freebsd4.4)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Reply-To: ports-jp@jp.FreeBSD.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+011218
X-Sequence: ports-jp 12309
Subject: [ports-jp 12309] Re: XINE with LinuxThreads
Errors-To: owner-ports-jp@jp.FreeBSD.org
Sender: owner-ports-jp@jp.FreeBSD.org
X-Originator: dai_fugo@geocities.co.jp

$B$H$j$"$($:EvLL$NLdBj$r2r7h$9$Y$/;E>e$2$F$_$^$7$?!#(BLinuxThreads$B$r(B
$B%j%s%/$9$k$HL@$i$+$KIT0BDj$K$J$k$h$&$G$9$,!#(B

PTHREAD_CFLAGS/PTHREAD_LIBS$B$N%5%]!<%H$O$-$A$s$H$d$C$F$*$/(B
$B$Y$-$G$7$g$&$+$i!"$5$7$"$?$j(BLinuxThreads$B4X78$N2U=j$O30$7$F(B
send-pr$B$7$h$&$+$H$b9M$($F$k$s$G$9$,!"$I$&$7$^$7$g$&$+!#(B

diff -urN /usr/ports/graphics/libxine/Makefile libxine/Makefile
--- /usr/ports/graphics/libxine/Makefile	Thu Jan 24 20:03:24 2002
+++ libxine/Makefile	Sat Jan 26 00:00:00 2002
@@ -7,6 +7,7 @@
 
 PORTNAME=	xine
 PORTVERSION=	0.9.8
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	http://xine.sourceforge.net/files/ \
 		${MASTER_SITE_SOURCEFORGE}
@@ -22,16 +23,28 @@
 		intl.1:${PORTSDIR}/devel/gettext
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-lib-${PORTVERSION}
-CONFIGURE_ARGS=	--with-w32-path=${LOCALBASE}/lib/win32
-CONFIGURE_ENV=	CPPFLAGS=-I${LOCALBASE}/include LIBS=-L${LOCALBASE}/lib
 
-USE_AUTOMAKE=	yes
-USE_GMAKE=	yes
 USE_X_PREFIX=	yes
-USE_IMLIB=	yes
 USE_ESOUND=	yes
+USE_IMLIB=	yes
+USE_GMAKE=	yes
+USE_AUTOMAKE=	yes
+CONFIGURE_ENV=	CPPFLAGS="-I./.. -I${LOCALBASE}/include" \
+		LDFLAGS="-L${LOCALBASE}/lib" \
+		THREAD_CFLAGS="${THREAD_CFLAGS}" \
+		THREAD_LIBS="${THREAD_LIBS}"
+CONFIGURE_ARGS=	--with-w32-path=${LOCALBASE}/lib/win32
 INSTALLS_SHLIB=	yes
 
+.if defined(WITH_LINUXTHREADS)
+LIB_DEPENDS+=	lthread.2:${PORTSDIR}/devel/linuxthreads
+THREAD_CFLAGS=	-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
+THREAD_LIBS=	-llthread -llgcc_r -L${LOCALBASE}/lib
+.else
+THREAD_CFLAGS=	${PTHREAD_CFLAGS}
+THREAD_LIBS=	${PTHREAD_LIBS}
+.endif
+
 MAN1=		xine-config.1
 MAN3=		ao_driver_t.3 ao_functions_t.3 autoplay_group.3 \
 		audio_cap.3 audio_group.3 audio_prop.3 \
@@ -74,9 +87,18 @@
 PLIST_SUB+=	HAVE_OGG="@comment "
 .endif
 
-# XXX: To avoid internal error in gcc.
-post-configure:
-	@${SED} -e "s/-funroll-loops//" < ${WRKSRC}/src/libw32dll/wine/Makefile > ${WRKSRC}/src/libw32dll/wine/Makefile.tmp
-	@${MV} ${WRKSRC}/src/libw32dll/wine/Makefile.tmp ${WRKSRC}/src/libw32dll/wine/Makefile
+post-patch:
+	@${PERL} -pi -e \
+		's|THREAD_LIBS=.*$$|THREAD_LIBS="\$$THREAD_LIBS"|g ; \
+		 s|THREAD_CFLAGS=.*$$|THREAD_CFLAGS="\$$THREAD_CFLAGS"|g ; \
+		 s|-L/usr/local/lib||g ; \
+		 s|-I/usr/local/include||g ; \
+		 s|-funroll-loops||g ; \
+		 s|-D_REENTRANT||g' ${WRKSRC}/configure.in
+	@${PERL} -pi -e \
+		's|aclocal,|${ACLOCAL},|g ; \
+		 s|autoconf,|${AUTOCONF},|g ; \
+		 s|automake,|${AUTOMAKE},|g ; \
+		 s|autoheader,|${AUTOHEADER},|g' ${WRKSRC}/aclocal.m4
 
 .include <bsd.port.post.mk>
diff -urN /usr/ports/graphics/libxine/files/patch-ltmain.sh libxine/files/patch-ltmain.sh
--- /usr/ports/graphics/libxine/files/patch-ltmain.sh	Thu Jan  1 09:00:00 1970
+++ libxine/files/patch-ltmain.sh	Sat Jan 26 00:00:00 2002
@@ -0,0 +1,23 @@
+--- ltmain.sh.orig	Wed Jan 16 09:00:24 2002
++++ ltmain.sh	Fri Jan 25 05:08:03 2002
+@@ -958,6 +958,7 @@
+ 	;;
+ 
+       -avoid-version)
++	build_old_libs=no
+ 	avoid_version=yes
+ 	continue
+ 	;;
+@@ -4247,10 +4248,12 @@
+ 	fi
+ 
+ 	# Install the pseudo-library for information purposes.
++	if /usr/bin/false; then
+ 	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ 	instname="$dir/$name"i
+ 	$show "$install_prog $instname $destdir/$name"
+ 	$run eval "$install_prog $instname $destdir/$name" || exit $?
++	fi
+ 
+ 	# Maybe install the static library, too.
+ 	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
diff -urN /usr/ports/graphics/libxine/pkg-plist libxine/pkg-plist
--- /usr/ports/graphics/libxine/pkg-plist	Thu Jan 24 20:03:26 2002
+++ libxine/pkg-plist	Sat Jan 26 00:00:00 2002
@@ -22,87 +22,47 @@
 include/xine/xineintl.h
 include/xine/xineutils.h
 include/xine.h
-lib/libxine.la
 lib/libxine.so
 lib/libxine.so.0
-lib/libxineutils.la
 lib/libxineutils.so
 lib/libxineutils.so.0
-%%HAVE_ARTS%%lib/xine/plugins/xineplug_ao_out_arts.la
 %%HAVE_ARTS%%lib/xine/plugins/xineplug_ao_out_arts.so
-lib/xine/plugins/xineplug_ao_out_esd.la
 lib/xine/plugins/xineplug_ao_out_esd.so
-lib/xine/plugins/xineplug_ao_out_oss.la
 lib/xine/plugins/xineplug_ao_out_oss.so
-lib/xine/plugins/xineplug_decode_a52.la
 lib/xine/plugins/xineplug_decode_a52.so
-lib/xine/plugins/xineplug_decode_divx4.la
 lib/xine/plugins/xineplug_decode_divx4.so
-lib/xine/plugins/xineplug_decode_dts.la
 lib/xine/plugins/xineplug_decode_dts.so
-lib/xine/plugins/xineplug_decode_vfill.la
 lib/xine/plugins/xineplug_decode_vfill.so
-lib/xine/plugins/xineplug_decode_ff.la
 lib/xine/plugins/xineplug_decode_ff.so
-lib/xine/plugins/xineplug_decode_lpcm.la
 lib/xine/plugins/xineplug_decode_lpcm.so
-lib/xine/plugins/xineplug_decode_mad.la
 lib/xine/plugins/xineplug_decode_mad.so
-lib/xine/plugins/xineplug_decode_mpeg2.la
 lib/xine/plugins/xineplug_decode_mpeg2.so
-lib/xine/plugins/xineplug_decode_spu.la
 lib/xine/plugins/xineplug_decode_spu.so
-lib/xine/plugins/xineplug_decode_spucc.la
 lib/xine/plugins/xineplug_decode_spucc.so
-lib/xine/plugins/xineplug_decode_sputext.la
 lib/xine/plugins/xineplug_decode_sputext.so
-%%HAVE_VORBIS%%lib/xine/plugins/xineplug_decode_vorbis.la
 %%HAVE_VORBIS%%lib/xine/plugins/xineplug_decode_vorbis.so
-lib/xine/plugins/xineplug_decode_w32dll.la
 lib/xine/plugins/xineplug_decode_w32dll.so
-lib/xine/plugins/xineplug_dmx_asf.la
 lib/xine/plugins/xineplug_dmx_asf.so
-lib/xine/plugins/xineplug_dmx_avi.la
 lib/xine/plugins/xineplug_dmx_avi.so
-lib/xine/plugins/xineplug_dmx_cda.la
 lib/xine/plugins/xineplug_dmx_cda.so
-lib/xine/plugins/xineplug_dmx_mpeg.la
 lib/xine/plugins/xineplug_dmx_mpeg.so
-lib/xine/plugins/xineplug_dmx_mpeg_audio.la
 lib/xine/plugins/xineplug_dmx_mpeg_audio.so
-lib/xine/plugins/xineplug_dmx_mpeg_block.la
 lib/xine/plugins/xineplug_dmx_mpeg_block.so
-lib/xine/plugins/xineplug_dmx_mpeg_elem.la
 lib/xine/plugins/xineplug_dmx_mpeg_elem.so
-lib/xine/plugins/xineplug_dmx_mpeg_pes.la
 lib/xine/plugins/xineplug_dmx_mpeg_pes.so
-lib/xine/plugins/xineplug_dmx_mpeg_ts.la
 lib/xine/plugins/xineplug_dmx_mpeg_ts.so
-%%HAVE_OGG%%lib/xine/plugins/xineplug_dmx_ogg.la
 %%HAVE_OGG%%lib/xine/plugins/xineplug_dmx_ogg.so
-lib/xine/plugins/xineplug_dmx_qt.la
 lib/xine/plugins/xineplug_dmx_qt.so
-lib/xine/plugins/xineplug_inp_dvd.la
 lib/xine/plugins/xineplug_inp_dvd.so
-lib/xine/plugins/xineplug_inp_file.la
 lib/xine/plugins/xineplug_inp_file.so
-lib/xine/plugins/xineplug_inp_http.la
 lib/xine/plugins/xineplug_inp_http.so
-lib/xine/plugins/xineplug_inp_net.la
 lib/xine/plugins/xineplug_inp_net.so
-lib/xine/plugins/xineplug_inp_rtp.la
 lib/xine/plugins/xineplug_inp_rtp.so
-lib/xine/plugins/xineplug_inp_stdin_fifo.la
 lib/xine/plugins/xineplug_inp_stdin_fifo.so
-lib/xine/plugins/xineplug_inp_vcd.la
 lib/xine/plugins/xineplug_inp_vcd.so
-lib/xine/plugins/xineplug_vo_out_aa.la
 lib/xine/plugins/xineplug_vo_out_aa.so
-lib/xine/plugins/xineplug_vo_out_syncfb.la
 lib/xine/plugins/xineplug_vo_out_syncfb.so
-lib/xine/plugins/xineplug_vo_out_xshm.la
 lib/xine/plugins/xineplug_vo_out_xshm.so
-%%HAVE_LIBXV%%lib/xine/plugins/xineplug_vo_out_xv.la
 %%HAVE_LIBXV%%lib/xine/plugins/xineplug_vo_out_xv.so
 share/doc/xine/xine-lib-API/html/annotated.html
 share/doc/xine/xine-lib-API/html/doxygen.css
diff -urN /usr/ports/graphics/xine/Makefile xine/Makefile
--- /usr/ports/graphics/xine/Makefile	Thu Jan 24 20:04:31 2002
+++ xine/Makefile	Sat Jan 26 00:00:00 2002
@@ -7,6 +7,7 @@
 
 PORTNAME=	xine
 PORTVERSION=	0.9.8
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	http://xine.sourceforge.net/files/ \
 		${MASTER_SITE_SOURCEFORGE}
@@ -20,15 +21,24 @@
 		png.5:${PORTSDIR}/graphics/png \
 		intl.1:${PORTSDIR}/devel/gettext
 
-GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
 USE_X_PREFIX=	yes
 USE_IMLIB=	yes
-USE_LIBTOOL=	yes
+USE_GMAKE=	yes
+GNU_CONFIGURE=	yes
+CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
+		LDFLAGS="-L${LOCALBASE}/lib" \
+		THREAD_CFLAGS="${THREAD_CFLAGS}" \
+		THREAD_LIBS="${THREAD_LIBS}"
 CONFIGURE_ARGS=	--with-w32-path=${LOCALBASE}/lib/win32
-CONFIGURE_ENV=	CFLAGS="-I${LOCALBASE}/include" \
-			CPPFLAGS="-I${LOCALBASE}/include" \
-			LIBS="-L${LOCALBASE}/lib"
+
+.if defined(WITH_LINUXTHREADS)
+LIB_DEPENDS+=	lthread.2:${PORTSDIR}/devel/linuxthreads
+THREAD_CFLAGS=	-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
+THREAD_LIBS=	-llthread -llgcc_r -L${LOCALBASE}/lib
+.else
+THREAD_CFLAGS=	${PTHREAD_CFLAGS}
+THREAD_LIBS=	${PTHREAD_LIBS} 
+.endif
 
 MANLANG=	"" es fr pl
 MAN1=		aaxine.1 xine.1
@@ -44,8 +54,13 @@
 .endif
 .endif
 
-post-configure:
-	@${LN} -sf ${LOCALBASE}/bin/libtool ${WRKSRC}
+post-patch:
+	@${PERL} -pi -e \
+		's|THREAD_LIBS=.*$$|THREAD_LIBS="\$$THREAD_LIBS"|g ; \
+		 s|THREAD_CFLAGS=.*$$|THREAD_CFLAGS="\$$THREAD_CFLAGS"|g ; \
+		 s|-L/usr/local/lib||g ; \
+		 s|-I/usr/local/include||g ; \
+		 s|-D_REENTRANT||g' ${WRKSRC}/configure
 
 post-install:
 	@${CP} ${PREFIX}/man/man1/aaxine.1 ${PREFIX}/man/fr/man1/aaxine.1
diff -urN /usr/ports/graphics/xine_d4d_plugin/Makefile xine_d4d_plugin/Makefile
--- /usr/ports/graphics/xine_d4d_plugin/Makefile	Wed Dec 12 20:03:30 2001
+++ xine_d4d_plugin/Makefile	Sat Jan 26 00:00:00 2002
@@ -7,6 +7,7 @@
 
 PORTNAME=	xine_d4d_plugin
 PORTVERSION=	0.3.0
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	http://www.geocities.com/captain_css/
 
@@ -14,9 +15,28 @@
 
 LIB_DEPENDS=	xine.0:${PORTSDIR}/graphics/libxine
 
+USE_X_PREFIX=	yes
 GNU_CONFIGURE=	yes
-USE_X_PREFIX=		yes
+CONFIGURE_ENV=	THREAD_CFLAGS="${THREAD_CFLAGS}" \
+		THREAD_LIBS="${THREAD_LIBS}"
 INSTALLS_SHLIB=	yes
+
+.if defined(WITH_LINUXTHREADS)
+LIB_DEPENDS+=	lthread.2:${PORTSDIR}/devel/linuxthreads
+THREAD_CFLAGS=	-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
+THREAD_LIBS=	-llthread -llgcc_r -L${LOCALBASE}/lib
+.else
+THREAD_CFLAGS=	${PTHREAD_CFLAGS}
+THREAD_LIBS=	${PTHREAD_LIBS} 
+.endif
+
+post-patch:
+	@${PERL} -pi -e \
+		's|THREAD_LIBS=.*$$|THREAD_LIBS="\$$THREAD_LIBS"|g ; \
+		 s|THREAD_CFLAGS=.*$$|THREAD_CFLAGS="\$$THREAD_CFLAGS"|g ; \
+		 s|-L/usr/local/lib||g ; \
+		 s|-I/usr/local/include||g ; \
+		 s|-D_REENTRANT||g' ${WRKSRC}/configure
 
 post-install:
 	@${CAT} ${PKGMESSAGE}
diff -urN /usr/ports/graphics/xine_d4d_plugin/files/patch-ltmain.sh xine_d4d_plugin/files/patch-ltmain.sh
--- /usr/ports/graphics/xine_d4d_plugin/files/patch-ltmain.sh	Thu Jan  1 09:00:00 1970
+++ xine_d4d_plugin/files/patch-ltmain.sh	Sat Jan 26 00:00:00 2002
@@ -0,0 +1,49 @@
+--- ltmain.sh.orig	Mon Nov 12 16:27:33 2001
++++ ltmain.sh	Fri Jan 25 23:31:44 2002
+@@ -956,6 +956,7 @@
+ 	;;
+ 
+       -avoid-version)
++	build_old_libs=no
+ 	avoid_version=yes
+ 	continue
+ 	;;
+@@ -1043,14 +1044,14 @@
+ 	    # These systems don't actually have a C library (as such)
+ 	    test "X$arg" = "X-lc" && continue
+ 	    ;;
+-	  *-*-openbsd*)
++	  *-*-openbsd* | *-*-freebsd*)
+ 	    # Do not include libc due to us having libc/libc_r.
+ 	    test "X$arg" = "X-lc" && continue
+ 	    ;;
+ 	  esac
+ 	 elif test "X$arg" = "X-lc_r"; then
+ 	  case $host in
+-	  *-*-openbsd*)
++	  *-*-openbsd* | *-*-freebsd*)
+ 	    # Do not include libc_r directly, use -pthread flag.
+ 	    continue
+ 	    ;;
+@@ -2446,7 +2447,7 @@
+ 	  *-*-netbsd*)
+ 	    # Don't link with libc until the a.out ld.so is fixed.
+ 	    ;;
+-	  *-*-openbsd*)
++	  *-*-openbsd* | *-*-freebsd*)
+ 	    # Do not include libc due to us having libc/libc_r.
+ 	    ;;
+ 	  *)
+@@ -4215,10 +4216,12 @@
+ 	fi
+ 
+ 	# Install the pseudo-library for information purposes.
++	if /usr/bin/false; then
+ 	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ 	instname="$dir/$name"i
+ 	$show "$install_prog $instname $destdir/$name"
+ 	$run eval "$install_prog $instname $destdir/$name" || exit $?
++	fi
+ 
+ 	# Maybe install the static library, too.
+ 	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
diff -urN /usr/ports/graphics/xine_d4d_plugin/pkg-plist xine_d4d_plugin/pkg-plist
--- /usr/ports/graphics/xine_d4d_plugin/pkg-plist	Sat Dec  1 05:19:16 2001
+++ xine_d4d_plugin/pkg-plist	Sat Jan 26 00:00:00 2002
@@ -1,3 +1,2 @@
-lib/xine/plugins/xineplug_inp_d4d.la
 lib/xine/plugins/xineplug_inp_d4d.so
 @unexec rmdir %D/lib/xine/plugins 2>/dev/null || true
