From tijl@coosemans.org  Sat May  3 21:59:50 2014
Return-Path: <tijl@coosemans.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 486393B7
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  3 May 2014 21:59:50 +0000 (UTC)
Received: from mailrelay002.isp.belgacom.be (mailrelay002.isp.belgacom.be [195.238.6.175])
	by mx1.freebsd.org (Postfix) with ESMTP id DA03C1C13
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  3 May 2014 21:59:48 +0000 (UTC)
Received: from 89.166-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.166.89])
  by relay.skynet.be with ESMTP; 03 May 2014 23:59:40 +0200
Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1])
	by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s43LxdSr082427
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 3 May 2014 23:59:39 +0200 (CEST)
	(envelope-from tijl@kalimero.tijl.coosemans.org)
Received: (from tijl@localhost)
	by kalimero.tijl.coosemans.org (8.14.8/8.14.8/Submit) id s43Lxd50082426;
	Sat, 3 May 2014 23:59:39 +0200 (CEST)
	(envelope-from tijl)
Message-Id: <201405032159.s43Lxd50082426@kalimero.tijl.coosemans.org>
Date: Sat, 3 May 2014 23:59:39 +0200 (CEST)
From: Tijl Coosemans <tijl@FreeBSD.org>
Reply-To: Tijl Coosemans <tijl@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] textproc/flex: make libfl_pic.a actually pic
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         189323
>Category:       ports
>Synopsis:       [patch] textproc/flex: make libfl_pic.a actually pic
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    johans
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 03 22:00:00 UTC 2014
>Closed-Date:    Mon May 05 15:53:37 UTC 2014
>Last-Modified:  Mon May  5 16:00:01 UTC 2014
>Originator:     Tijl Coosemans
>Release:        FreeBSD 11.0-CURRENT i386
>Organization:
>Environment:
>Description:
Currently libfl_pic.a is compiled as a regular static library without
-fpic so it is exactly the same as libfl.a.

The attached patch modifies Makefile.am to add the -prefer-pic libtool
flag.  It also adds the --tag=disable-shared flag so a shared library
is never built (it would be the same as libfl.so).

This requires running automake which requires aclocal which in turn
implies autoconf and autoheader.

The RANLIB patching in post-patch is removed because it has no effect.
The "tests" patching has been included in the Makefile.am patch
because automake complains about the trailing backslash otherwise.
The MAKEINFO patching is handled in CONFIGURE_ENV.

This will be used to fix a problem in devel/libmatheval:
https://redports.org/buildarchive/20140503201200-15078/
https://redports.org/buildarchive/20140503214120-38210/

Redports: https://redports.org/buildarchive/20140503214000-47181/
>How-To-Repeat:
>Fix:

--- flex.patch begins here ---
Index: textproc/flex/Makefile
===================================================================
--- textproc/flex/Makefile	(revision 352934)
+++ textproc/flex/Makefile	(working copy)
@@ -2,6 +2,7 @@
 
 PORTNAME=	flex
 PORTVERSION=	2.5.39
+PORTREVISION=	1
 CATEGORIES=	textproc
 MASTER_SITES=	SF/${PORTNAME}
 
@@ -12,11 +13,13 @@ BUILD_DEPENDS=	help2man:${PORTSDIR}/misc
 		gm4:${PORTSDIR}/devel/m4
 RUN_DEPENDS=	gm4:${PORTSDIR}/devel/m4
 
-USES=		bison gmake tar:bzip2
+USES=		bison gmake libtool:keepla tar:bzip2
+USE_AUTOTOOLS=	aclocal autoconf autoheader automake
+ACLOCAL_ARGS=	-I m4
 GNU_CONFIGURE=	yes
 # install flex header to its own dir to avoid conflict with system flex.
 CONFIGURE_ARGS=	--includedir=${PREFIX}/include/flex --disable-shared
-CONFIGURE_ENV=	M4=${LOCALBASE}/bin/gm4
+CONFIGURE_ENV=	M4=${LOCALBASE}/bin/gm4 MAKEINFO="makeinfo --no-split"
 INSTALL_TARGET=	install-strip
 
 INFO=		flex
@@ -27,12 +30,6 @@ NLS_USES=	gettext iconv
 NLS_CONFIGURE_ENABLE=	nls
 
 post-patch:	.SILENT
-	${REINPLACE_CMD} -Ee 's/tests//' \
-		-e 's/^([[:space:]]*)\$$\(RANLIB\) ([^ ;]*)/\1chmod u+w \2;&/' \
-		-e '/echo.*RANLIB/,+1d' \
-		${WRKSRC}/Makefile.in
-	${REINPLACE_CMD} -e 's/@MAKEINFO@/& --no-split/g' \
-		${WRKSRC}/doc/Makefile.in
 	${RM} -f ${WRKSRC}/doc/*.info*
 
 .include <bsd.port.mk>
Index: textproc/flex/files/patch-Makefile.am
===================================================================
--- textproc/flex/files/patch-Makefile.am	(revision 0)
+++ textproc/flex/files/patch-Makefile.am	(working copy)
@@ -0,0 +1,21 @@
+--- Makefile.am.orig	2014-03-26 13:46:44.000000000 +0100
++++ Makefile.am	2014-05-03 23:29:10.000000000 +0200
+@@ -79,6 +79,8 @@
+ 	libmain.c \
+ 	libyywrap.c
+ 
++libfl_pic_la_CFLAGS = -prefer-pic
++libfl_pic_la_LIBTOOLFLAGS = --tag=disable-shared
+ libfl_pic_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
+ 
+ noinst_HEADERS = \
+@@ -119,8 +121,7 @@
+ 	. \
+ 	doc \
+ 	examples \
+-	po \
+-	tests
++	po
+ 
+ localedir = $(datadir)/locale
+ AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl

Property changes on: textproc/flex/files/patch-Makefile.am
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
--- flex.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->johans 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat May 3 22:00:04 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: Johan van Selst <johans@FreeBSD.org>
To: Tijl Coosemans <tijl@FreeBSD.org>
Cc: Maarten <maarten@famseinhorst.nl>, bug-followup@FreeBSD.org
Subject: Re: ports/189323: [patch] textproc/flex: make libfl_pic.a actually
 pic
Date: Sun, 4 May 2014 18:01:25 +0200

 --/9DWx/yDrRhgMJTb
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi Tijl,
 
 Chances are that devel/libmatheval does not in fact need or use
 libfl_pic. At least, that is what we see with other ports that try to
 link with this library. It appears to be due to some old configure
 script cargo cult hacking. I did not look at libmatheval myself.
 
 I'll try and correct the library anyway, as this is clearly a bug. But
 preferably without running automake, aclocal, autoconf and autoheader -
 which would make it rather fragile and slow.
 
 
 Regards,
 Johan
 
 --/9DWx/yDrRhgMJTb
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 
 iF4EAREIAAYFAlNmZFUACgkQAEpMHW8nCPRloQEA08LNNO0yMhdqLQuISI5iO3b+
 aVJgFwj4DCw3M/wDh0oA/iIILdQmHM6bMNTLvaCXO0vjFK2prJ/W8Xx0WH0ETUwM
 =BLKV
 -----END PGP SIGNATURE-----
 
 --/9DWx/yDrRhgMJTb--
State-Changed-From-To: open->closed 
State-Changed-By: johans 
State-Changed-When: Mon May 5 15:51:36 UTC 2014 
State-Changed-Why:  
Committed with a modified patch. 
Less sexy, but it avoids the autotools circus. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/189323: commit references a PR
Date: Mon,  5 May 2014 15:51:07 +0000 (UTC)

 Author: johans
 Date: Mon May  5 15:51:04 2014
 New Revision: 353028
 URL: http://svnweb.freebsd.org/changeset/ports/353028
 QAT: https://qat.redports.org/buildarchive/r353028/
 
 Log:
   Make sure static library libfl_pic.a contains position independent code.
   This fixes compilation of ports that insist on linking this library
   into a shared object file (specifically devel/libmatheval).
   
   While here, remove unused ranlib patch lines.
   
   PR:		ports/189323
   Submitted by:	tijl
 
 Modified:
   head/textproc/flex/Makefile
 
 Modified: head/textproc/flex/Makefile
 ==============================================================================
 --- head/textproc/flex/Makefile	Mon May  5 15:31:20 2014	(r353027)
 +++ head/textproc/flex/Makefile	Mon May  5 15:51:04 2014	(r353028)
 @@ -2,6 +2,7 @@
  
  PORTNAME=	flex
  PORTVERSION=	2.5.39
 +PORTREVISION=	1
  CATEGORIES=	textproc
  MASTER_SITES=	SF/${PORTNAME}
  
 @@ -16,7 +17,7 @@ USES=		bison gmake tar:bzip2
  GNU_CONFIGURE=	yes
  # install flex header to its own dir to avoid conflict with system flex.
  CONFIGURE_ARGS=	--includedir=${PREFIX}/include/flex --disable-shared
 -CONFIGURE_ENV=	M4=${LOCALBASE}/bin/gm4
 +CONFIGURE_ENV=	M4=${LOCALBASE}/bin/gm4 MAKEINFO="makeinfo --no-split"
  INSTALL_TARGET=	install-strip
  
  INFO=		flex
 @@ -28,11 +29,8 @@ NLS_CONFIGURE_ENABLE=	nls
  
  post-patch:	.SILENT
  	${REINPLACE_CMD} -Ee 's/tests//' \
 -		-e 's/^([[:space:]]*)\$$\(RANLIB\) ([^ ;]*)/\1chmod u+w \2;&/' \
 -		-e '/echo.*RANLIB/,+1d' \
 +		-e '/mode=compile ..CC/s/\\$$/-fPIC -DPIC &/' \
  		${WRKSRC}/Makefile.in
 -	${REINPLACE_CMD} -e 's/@MAKEINFO@/& --no-split/g' \
 -		${WRKSRC}/doc/Makefile.in
  	${RM} -f ${WRKSRC}/doc/*.info*
  
  .include <bsd.port.mk>
 _______________________________________________
 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"
 
>Unformatted:
