Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Feb 2001 14:40:45 -0300
From:      "Mario Sergio Fujikawa Ferreira" <lioux@uol.com.br>
To:        freebsd-ports@freebsd.org
Subject:   FreeBSD port openjade patch
Message-ID:  <20010226144045.A27621@Fedaykin.here>

next in thread | raw e-mail | index | archive | help
Hi,

	I've got the MAINTAINER's approval to apply a patch to the
current's textproc/openjade but I am looking for clarification.
	I am trying to "dinamically clean" CFLAGS so that this port
builds and works safely. I am removing all -m* and -O[s2-9]
optimizations but I would like to retain all other flags; therefore,
having a partially safe CFLAGS port, ala palm/prc-tools-gcc.

	Following the palm/prc-tools-gcc example, I am trying
to use sed but I having trouble. I've got my desired results
with perl but can't reproduce them with sed.
	Why the following sed and perl regexps are not similar?

	1) ${SED} -e 's/-m[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?//g' \
		-e 's/-O[s2-9]+//g
	2) ${PERL} -p -ne "s/-O[s2-9]+//g;s/-m[0-9a-z]+(=[0-9a-z]*)?//g"

	Applied against the following test
CFLAGS=-O -pipe -Wall -march=pentium -mcpu=pentium -mpentium -Os
I get the following respective results:

	1) CFLAGS=-O -pipe -Wall -mpentium -march=pentium -mcpu=pentium -Os
	2) CFLAGS=-O -pipe -Wall

	What am I missing in the sed regexp? I need a result
similar to the perl one. Idea?
	I am forwarding a copy of the email I've sent the
openjade's MAINTAINER regarding the patch. You can verify
that this patch uses a static CFLAGS, but I am working on
a dinamic one.

	Regards,

------------ Forwarded email

	I just thought you would like to know that using openjade-1.3
built with GCC optimizations such as

CFLAGS+=pipe -Wall -march=pentium -mcpu=pentium -Os

core dumps when trying to build some of the files inside
/usr/doc/en_US.ISO_8859-1/

	Just try a 'make clean all' under it

	OS: FreeBSD 4.2-STABLE as of today
	DOCS: /usr/doc as of today

	Removing '-Os' did not fix it. Only by removing both
'-march=pentium -mcpu=pentium' and '-Os' fixed it. I reverted to
'CFLAGS=-O -pipe -Wall' to get it working.

	I know that it is not guaranteed that any optimizations
beside -O will work; therefore, rendering this problem as my fault,
but I thought you would like to know that this port (IMHO) should
be treated as CFLAGS unsafe and that its CFLAGS should be hardwired
to '-O -pipe'. This would help avoiding false positives: the port
compiles, the openjade binary works with some sgml files but core
dumps with others.
	However, when the port uses the simple CFLAGS='-O -pipe',
it compiles the whole /usr/doc cleanly.
	I am attaching a proposed patch used on my system.
If you are unsure if you should do this, please consult
with -doc. I know this fix my system but it would be good
to cross check other ppl actively using this
with different installations, e.g., -doc ppl.

	Another issue, openjade complains it can't find
/usr/local/share/builtins.dsl. It is correct since this file resides
under /usr/local/share/sgml/openjade/builtins.dsl
	I did a patch for that too. Just added a CONFIGURE_ARGS
argument.

	Furthermore, INSTALLS_SHLIB is the right way
to do the ldconfig part of your post-install.

	I hope you find this useful.

	Regards,

ps: I bumped PORTREVISION because there was a fix on the port.

--- /usr/ports/textproc/openjade/Makefile	Tue Feb  6 04:17:53 2001
+++ Makefile	Sat Feb 24 00:41:02 2001
@@ -7,6 +7,7 @@
 
 PORTNAME=	openjade
 PORTVERSION=	1.3
+PORTREVISION=	1
 CATEGORIES=	textproc
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -16,7 +17,13 @@
 USE_GMAKE=	YES
 USE_LIBTOOL=	YES
 CONFIGURE_ENV=	CXXFLAGS="${CFLAGS}"
-CONFIGURE_ARGS=	--enable-default-catalog=${PREFIX}/share/sgml/catalog
+CONFIGURE_ARGS=	--enable-default-catalog=${PREFIX}/share/sgml/catalog \
+		--datadir=${PREFIX}/share/sgml/openjade
+INSTALLS_SHLIB=	yes
+
+# This port is CFLAGS unsafe, using optimizations such as
+# 'march=-mpentium -Os' produces core dumps with certain input files
+CFLAGS=	-O -pipe
 
 pre-install:
 	@find ${WRKSRC} \( -name \*.orig -o -name \*~ \) -exec ${RM} -f \{} \;
@@ -24,6 +31,5 @@
 post-install:
 	${MKDIR} ${PREFIX}/share/sgml/openjade
 	${INSTALL_DATA} ${WRKSRC}/dsssl/* ${PREFIX}/share/sgml/openjade
-	${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m $(PREFIX)/lib
 
 .include <bsd.port.mk>


----- End forwarded message -----

-- 
Mario S F Ferreira - UnB - Brazil - "I guess this is a signature."
lioux at ( freebsd dot org | linf dot unb dot br )
flames to beloved devnull@someotherworldbeloworabove.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010226144045.A27621>