From nobody@FreeBSD.org  Tue Jan 22 21:11:14 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 588A7F27
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Jan 2013 21:11:14 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 31F40381
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Jan 2013 21:11:14 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r0MLBD58044497
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Jan 2013 21:11:13 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r0MLBDuB044488;
	Tue, 22 Jan 2013 21:11:13 GMT
	(envelope-from nobody)
Message-Id: <201301222111.r0MLBDuB044488@red.freebsd.org>
Date: Tue, 22 Jan 2013 21:11:13 GMT
From: Jack Pappas <jack.pappas@tidepowerd.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Mono is not configured correctly when building
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175518
>Category:       ports
>Synopsis:       lang/mono is not configured correctly when building
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mono
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 22 21:20:00 UTC 2013
>Closed-Date:    Mon Feb 04 21:58:21 UTC 2013
>Last-Modified:  Mon Feb  4 22:00:02 UTC 2013
>Originator:     Jack Pappas
>Release:        9-STABLE
>Organization:
>Environment:
FreeBSD jack-bsd 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r245748M: Mon Jan 21 20:56:47 EST 2013     root@jack-bsd:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The lang/mono port (recently updated for Mono 3.0.3) isn't configured correctly before building, because it does not call the 'autogen.sh' script provided in the Mono distribution. The 'autogen.sh' script must be run _instead_ of simply calling autoconf (via GNU_CONFIGURE=yes) because it performs certain setup actions before calling libtool, then autoconf.

On a related note, I discovered this configuration issue while tweaking the main Mono configuration file to enable Mono's new 'sgen' GC. The diff attached to this PR includes a patch for configure.in which removes some configuration options which were explicitly set for FreeBSD; removing these settings allows the configure.in to auto-detect the correct settings to use for FreeBSD.

NOTE: The 'patch-configure.in' file included in the attached diff is new, so you will have to to 'svn add' it.
>How-To-Repeat:
Install the current version of Mono from the ports tree.
>Fix:
I have attached an SVN diff (against r310835) which:
(a) Alters the Makefile for lang/mono to correct the build-configuration issue (by calling autogen.sh instead of using autoconf).
(b) Patches configure.in so it selects the configuration options which enable Mono to be compiled using the new 'sgen' GC.

Patch attached with submission follows:

Index: Makefile
===================================================================
--- Makefile	(revision 310835)
+++ Makefile	(working copy)
@@ -17,11 +17,14 @@
 USE_GNOME=	gnomehack glib20
 USE_GMAKE=	yes
 USE_PERL5_BUILD=yes
-GNU_CONFIGURE=	yes
+HAS_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 USE_GETTEXT=	yes
 MAKE_JOBS_UNSAFE=yes
 
+# Call autogen.sh, which calls libtool, autoconf, etc.
+CONFIGURE_SCRIPT= autogen.sh
+
 # Moonlight is installed as part of www/moonlight
 CONFIGURE_ARGS=	--with-moonlight=no
 
Index: files/patch-configure.in
===================================================================
--- files/patch-configure.in	(revision 0)
+++ files/patch-configure.in	(working copy)
@@ -0,0 +1,13 @@
+--- ./configure.in.orig	2012-12-21 15:20:46.000000000 -0500
++++ ./configure.in	2012-12-21 15:21:10.000000000 -0500
+@@ -173,10 +173,6 @@
+ 		libgc_threads=pthreads
+ 		# This doesn't seem to work as of 7.0 on amd64
+ 		with_sigaltstack=no
+-# TLS is only partially implemented on -CURRENT (compiler support
+-# but NOT library support)
+-#
+-		with_tls=pthread
+ 		use_sigposix=yes
+ 		;;
+ 	*-*-*openbsd*)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->mono 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Jan 23 03:04:46 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175518 
State-Changed-From-To: open->analyzed 
State-Changed-By: romain 
State-Changed-When: Mon Feb 4 12:48:12 UTC 2013 
State-Changed-Why:  
lang/mono does not build after applying this patch: running the autohell 
chain require some files not provided in the source tarball.  Patching 
configure directly may work.  I am compiling ATM and if the results are 
okay, I'll commit this change. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175518 

From: Romain =?iso-8859-1?Q?Tarti=E8re?= <romain@blogreen.org>
To: bug-followup@FreeBSD.org, jack.pappas@tidepowerd.com
Cc:  
Subject: Re: ports/175518: lang/mono is not configured correctly when building
Date: Mon, 4 Feb 2013 21:17:43 +0100

 --neYutvxvOLaeuPCA
 Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn"
 Content-Disposition: inline
 
 
 --x+6KMIRAuhnl3hBn
 Content-Type: text/plain; charset=iso-8859-1
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Hello
 
 I could build lang/mono with just patching the configure script
 (attached) and `mono --gc=3Dsgen` seems ok.
 
 However, you say that mono is not configured correctly without running
 autogen.sh.  Can you please provide more details about what is different
 if you run it and if you directly use configure (assuming both are
 patched to remove 'with_tls=3Dpthread') ?  Or maybe you just wanted to
 avoid to patch this generated 'configure' file ?
 
 We do this because we try to avoit to bring-in all autotools
 dependencies (the port would require adding these extra dependencies to
 the Makefile using:
 
 USE_AUTOTOOLS=3D	libtool:env automake:env autoconf:env aclocal:env
 
 ).
 
 --=20
 Romain Tarti=E8re <romain@blogreen.org>        http://romain.blogreen.org/
 pgp: 8234 9A78 E7C0 B807 0B59  80FF BA4D 1D95 5112 336F (ID: 0x5112336F)
 (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated)
 
 --x+6KMIRAuhnl3hBn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=patch-configure
 
 
 $FreeBSD$
 
 --- configure.orig
 +++ configure
 @@ -3995,10 +3995,6 @@
  		libgc_threads=pthreads
  		# This doesn't seem to work as of 7.0 on amd64
  		with_sigaltstack=no
 -# TLS is only partially implemented on -CURRENT (compiler support
 -# but NOT library support)
 -#
 -		with_tls=pthread
  		use_sigposix=yes
  		;;
  	*-*-*openbsd*)
 
 --x+6KMIRAuhnl3hBn--
 
 --neYutvxvOLaeuPCA
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (FreeBSD)
 
 iQGcBAEBAgAGBQJREBdnAAoJELpNHZVREjNvxIsMAJCFepid0dqCaZ3HswrRQjFN
 Lzu/Sy2o/xKscV1VfxZBupU+m4HpNsOFYf4EGPM38SrwIRC7P7ID5IJZdxRBbXNq
 6m4iB9B+LP3+Ux5DnZ+SMn3D2c7ka5D+6rnwMKHWuq/R9sThxjVmH09g7TEz3n3s
 z3Z7uK8MgUhoCq41YwbsAk81VsjCZH59xGBFO2HroNDaatzFztIVyXgFYRDp6c7u
 BIzcs9YRKniveZhHkzMyHBcxRxWr2GnhemStPVrE2pGnt+SJXdqrtAa2NZ+EkHXU
 +u/eoLBialZMhHzloVHXFrAUn8bg/1S8idPHgUmo5y70usDXQb7JoQfN2ulk9Pl+
 GiZr1hr1byGcHd5QOB6pAPq4fuxMJ97b3UZveNTBfo5ik2ie3o9xGUXpqem9Brnq
 /zQDU9dOey95WCClPoGKjOJ0Aeccjuz2veQKBg5iRCYPOn2W5oN7JG5vyZOje4hS
 Zj07527HVzX78Zlwk921R9u4ReS4LMJLYLraoWMk5g==
 =+3Ru
 -----END PGP SIGNATURE-----
 
 --neYutvxvOLaeuPCA--

From: Jack Pappas <jack.pappas@tidepowerd.com>
To: =?ISO-8859-1?Q?Romain_Tarti=E8re?= <romain@blogreen.org>, 
	bug-followup@freebsd.org
Cc:  
Subject: RE: ports/175518: lang/mono is not configured correctly when building
Date: Mon, 4 Feb 2013 16:05:17 -0500

 Hi Romain,
 
 According to the Mono README
 (https://github.com/mono/mono/blob/master/README), the autogen.sh is only
 needed when building from a snapshot; for official tarballs (like the one
 used in the lang/mono port), it's not.
 
 However, the reason I wanted to use autogen.sh was because after I'd
 patched the configure.in file (and added the patch to the 'files'
 directory), I found that when I ran "make install clean", the patch
 wouldn't work -- Mono would still compile correctly, but it would still
 use the pthread API for thread-local storage (TLS) instead of the __thread
 qualifier. It was only after changing the makefile to call autogen.sh that
 Mono compiled successfully and used the __thread TLS.
 
 You said you were able to build lang/mono by just patching the configure
 script -- did you also install it after building? If so, you can run "mono
 -V" to see what kind of thread-local storage Mono was compiled with. If
 your installation of Mono is using the __thread TLS, then let's use your
 method of patching just the 'configure' file.
 
 Regards,
 Jack
 
 -----Original Message-----
 From: Romain Tarti=E8re [mailto:romain@blogreen.org]
 Sent: Monday, February 04, 2013 3:18 PM
 To: bug-followup@FreeBSD.org; jack.pappas@tidepowerd.com
 Subject: Re: ports/175518: lang/mono is not configured correctly when
 building
 
 Hello
 
 I could build lang/mono with just patching the configure script
 (attached) and `mono --gc=3Dsgen` seems ok.
 
 However, you say that mono is not configured correctly without running
 autogen.sh.  Can you please provide more details about what is different
 if you run it and if you directly use configure (assuming both are patched
 to remove 'with_tls=3Dpthread') ?  Or maybe you just wanted to avoid to
 patch this generated 'configure' file ?
 
 We do this because we try to avoit to bring-in all autotools dependencies
 (the port would require adding these extra dependencies to the Makefile
 using:
 
 USE_AUTOTOOLS=3D	libtool:env automake:env autoconf:env aclocal:env
 
 ).
 
 --
 Romain Tarti=E8re <romain@blogreen.org>        http://romain.blogreen.org/
 pgp: 8234 9A78 E7C0 B807 0B59  80FF BA4D 1D95 5112 336F (ID: 0x5112336F)
 (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated=
 )

From: Romain =?iso-8859-1?Q?Tarti=E8re?= <romain@blogreen.org>
To: Jack Pappas <jack.pappas@tidepowerd.com>
Cc: bug-followup@freebsd.org
Subject: Re: ports/175518: lang/mono is not configured correctly when building
Date: Mon, 4 Feb 2013 22:46:09 +0100

 --zYM0uCDKw75PZbzx
 Content-Type: text/plain; charset=iso-8859-1
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Mon, Feb 04, 2013 at 04:05:17PM -0500, Jack Pappas wrote:
 > According to the Mono README
 > (https://github.com/mono/mono/blob/master/README), the autogen.sh is only
 > needed when building from a snapshot; for official tarballs (like the one
 > used in the lang/mono port), it's not.
 >=20
 > However, the reason I wanted to use autogen.sh was because after I'd
 > patched the configure.in file (and added the patch to the 'files'
 > directory), I found that when I ran "make install clean", the patch
 > wouldn't work -- Mono would still compile correctly, but it would still
 > use the pthread API for thread-local storage (TLS) instead of the __thread
 > qualifier. It was only after changing the makefile to call autogen.sh that
 > Mono compiled successfully and used the __thread TLS.
 
 The 'configure' script is generated by the autotools from the
 'configure.in' file.  So modifying the 'configure.in' file require you
 to run all the autotools chain to regenerate the 'configure' script
 before continuing.  This is the reason you had to run 'autogen.sh'.
 
 When the mono folks release a new mono tarball, they include the generated
 'configure' script in it so we have to either patch 'configure.in' and re-r=
 un
 the whole autotools chain, or patch the generated 'configure' which avoids =
 us
 all the mess that commes with the autotools if we have to change something
 there.
 
 > You said you were able to build lang/mono by just patching the configure
 > script -- did you also install it after building? If so, you can run "mono
 > -V" to see what kind of thread-local storage Mono was compiled with. If
 > your installation of Mono is using the __thread TLS, then let's use your
 > method of patching just the 'configure' file.
 
 I get:
 
  JIT compiler version 3.0.3 (tarball Mon Feb  4 14:30:00 CET 2013)
 Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono=
 -project.com
 	TLS:           __thread
 	SIGSEGV:       normal
 	Notification:  kqueue
 	Architecture:  amd64
 	Disabled:      none
 	Misc:          softdebug=20
 	LLVM:          supported, not enabled.
 	GC:            Included Boehm (with typed GC and Parallel Mark)
 
 which is what you are expecting, right ?  Then I guess I can commit this
 change.
 
 Romain
 
 --=20
 Romain Tarti=E8re <romain@blogreen.org>        http://romain.blogreen.org/
 pgp: 8234 9A78 E7C0 B807 0B59  80FF BA4D 1D95 5112 336F (ID: 0x5112336F)
 (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated)
 
 --zYM0uCDKw75PZbzx
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (FreeBSD)
 
 iQGcBAEBAgAGBQJRECwhAAoJELpNHZVREjNvz7AL/0XCnuj9qUPqkh4Q3e7ZoBSs
 IydqxJMSDo7O5VMmXSvRCQpWCB1laBV2lxidc96qGwASK2/coiIcuho3/aLV0TUp
 AfRvdujhL4bNOaJFWpuUUU/qz6L3R6XyjaVxGAyo5qJ5n4z1NiH/xkH1hD/NkTJk
 ViWWssF/fc5tynFbU2sflMBTQTZz5lAdXvvyaW+nCV7PZGbEW0PJO3gLA3QlhB90
 nC7Ioby8YF91oXZXzxX+mqXFlHXAwhmi+J8lXb7Mrw6DMoYlZuSnVSs6D7zfGV7K
 /GKjXx8vwAYL8a5/1pAONtloB3XqQ0R1Gd2PgO0DQ0/Fmbcl86SafBf1MjA0LtN6
 R4zNbcy9+fy/vA8pkAJPzg9nSPG1L0lH5D7VjrapuKJ9SXfLSIdZDXKbFJpEmCH7
 oHgFxm6B0jNxzsVO8A5XFuy95JF/m5OJUM3cBncHme56WNnUqDtPJUP2nxZXX0u0
 DZw/088+N9rZcy7mzKvXTGxKJH6yP85YkYyCZsZQyw==
 =I0Dw
 -----END PGP SIGNATURE-----
 
 --zYM0uCDKw75PZbzx--
State-Changed-From-To: analyzed->closed 
State-Changed-By: romain 
State-Changed-When: Mon Feb 4 21:58:21 UTC 2013 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175518 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/175518: commit references a PR
Date: Mon,  4 Feb 2013 21:58:04 +0000 (UTC)

 Author: romain
 Date: Mon Feb  4 21:57:56 2013
 New Revision: 311650
 URL: http://svnweb.freebsd.org/changeset/ports/311650
 
 Log:
   Enable sgen.
   
   PR:		ports/175518
   Submitted by:	Jack Pappas <jack.pappas@tidepowerd.com>
 
 Added:
   head/lang/mono/files/patch-configure   (contents, props changed)
 Modified:
   head/lang/mono/Makefile
 
 Modified: head/lang/mono/Makefile
 ==============================================================================
 --- head/lang/mono/Makefile	Mon Feb  4 21:53:59 2013	(r311649)
 +++ head/lang/mono/Makefile	Mon Feb  4 21:57:56 2013	(r311650)
 @@ -3,6 +3,7 @@
  
  PORTNAME=	mono
  PORTVERSION=	3.0.3
 +PORTREVISION=	1
  CATEGORIES=	lang
  MASTER_SITES=	http://download.mono-project.com/sources/${PORTNAME}/
  
 
 Added: head/lang/mono/files/patch-configure
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/lang/mono/files/patch-configure	Mon Feb  4 21:57:56 2013	(r311650)
 @@ -0,0 +1,16 @@
 +
 +$FreeBSD$
 +
 +--- configure.orig
 ++++ configure
 +@@ -3995,10 +3995,6 @@
 + 		libgc_threads=pthreads
 + 		# This doesn't seem to work as of 7.0 on amd64
 + 		with_sigaltstack=no
 +-# TLS is only partially implemented on -CURRENT (compiler support
 +-# but NOT library support)
 +-#
 +-		with_tls=pthread
 + 		use_sigposix=yes
 + 		;;
 + 	*-*-*openbsd*)
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 

From: Jack Pappas <jack.pappas@tidepowerd.com>
To: =?ISO-8859-1?Q?Romain_Tarti=E8re?= <romain@blogreen.org>
Cc: bug-followup@freebsd.org
Subject: RE: ports/175518: lang/mono is not configured correctly when building
Date: Mon, 4 Feb 2013 16:55:19 -0500

 HI Romain,
 
 Yes, that's the output I was expecting, so you can commit the change
 whenever you're ready. Thank you for the explanation about the 'configure'
 script -- it does make a lot of sense for Mono to package the sources like
 that now that you mention it.
 
 Regards,
 Jack
 
 -----Original Message-----
 From: Romain Tarti=E8re [mailto:romain@blogreen.org]
 Sent: Monday, February 04, 2013 4:46 PM
 To: Jack Pappas
 Cc: bug-followup@freebsd.org
 Subject: Re: ports/175518: lang/mono is not configured correctly when
 building
 
 On Mon, Feb 04, 2013 at 04:05:17PM -0500, Jack Pappas wrote:
 > According to the Mono README
 > (https://github.com/mono/mono/blob/master/README), the autogen.sh is
 > only needed when building from a snapshot; for official tarballs (like
 > the one used in the lang/mono port), it's not.
 >
 > However, the reason I wanted to use autogen.sh was because after I'd
 > patched the configure.in file (and added the patch to the 'files'
 > directory), I found that when I ran "make install clean", the patch
 > wouldn't work -- Mono would still compile correctly, but it would
 > still use the pthread API for thread-local storage (TLS) instead of
 > the __thread qualifier. It was only after changing the makefile to
 > call autogen.sh that Mono compiled successfully and used the __thread
 TLS.
 
 The 'configure' script is generated by the autotools from the
 'configure.in' file.  So modifying the 'configure.in' file require you to
 run all the autotools chain to regenerate the 'configure' script before
 continuing.  This is the reason you had to run 'autogen.sh'.
 
 When the mono folks release a new mono tarball, they include the generated
 'configure' script in it so we have to either patch 'configure.in' and
 re-run the whole autotools chain, or patch the generated 'configure' which
 avoids us all the mess that commes with the autotools if we have to change
 something there.
 
 > You said you were able to build lang/mono by just patching the
 > configure script -- did you also install it after building? If so, you
 > can run "mono -V" to see what kind of thread-local storage Mono was
 > compiled with. If your installation of Mono is using the __thread TLS,
 > then let's use your method of patching just the 'configure' file.
 
 I get:
 
  JIT compiler version 3.0.3 (tarball Mon Feb  4 14:30:00 CET 2013)
 Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors.
 www.mono-project.com
 	TLS:           __thread
 	SIGSEGV:       normal
 	Notification:  kqueue
 	Architecture:  amd64
 	Disabled:      none
 	Misc:          softdebug
 	LLVM:          supported, not enabled.
 	GC:            Included Boehm (with typed GC and Parallel Mark)
 
 which is what you are expecting, right ?  Then I guess I can commit this
 change.
 
 Romain
 
 --
 Romain Tarti=E8re <romain@blogreen.org>        http://romain.blogreen.org/
 pgp: 8234 9A78 E7C0 B807 0B59  80FF BA4D 1D95 5112 336F (ID: 0x5112336F)
 (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated=
 )
>Unformatted:
