Bug 189323

Summary: [patch] textproc/flex: make libfl_pic.a actually pic
Product: Ports & Packages Reporter: Tijl Coosemans <tijl>
Component: Individual Port(s)Assignee: Johan van Selst <johans>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
flex.patch none

Description Tijl Coosemans freebsd_committer freebsd_triage 2014-05-03 23:00:00 UTC
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/
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-03 23:00:04 UTC
Responsible Changed
From-To: freebsd-ports-bugs->johans

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Johan van Selst freebsd_committer freebsd_triage 2014-05-04 17:01:25 UTC
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
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-05-05 16:51:07 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"
Comment 4 Johan van Selst freebsd_committer freebsd_triage 2014-05-05 16:51:36 UTC
State Changed
From-To: open->closed

Committed with a modified patch. 
Less sexy, but it avoids the autotools circus.