From nobody@FreeBSD.org  Sat Mar 24 13:18:51 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 330EA106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Mar 2012 13:18:51 +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 1E4298FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Mar 2012 13:18:51 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ODIonN089487
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Mar 2012 13:18:50 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q2ODIoqr089486;
	Sat, 24 Mar 2012 13:18:50 GMT
	(envelope-from nobody)
Message-Id: <201203241318.q2ODIoqr089486@red.freebsd.org>
Date: Sat, 24 Mar 2012 13:18:50 GMT
From: Jakub Lach <jakub_lach@mailplus.pl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [x11] x11/libX11 fails if /usr/bin/cpp is clang
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         166373
>Category:       ports
>Synopsis:       x11/libX11 fails if /usr/bin/cpp is clang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-x11
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 24 13:20:08 UTC 2012
>Closed-Date:    Sun Jul 29 18:56:14 UTC 2012
>Last-Modified:  Sun Jul 29 18:56:14 UTC 2012
>Originator:     Jakub Lach
>Release:        9-STABLE amd64
>Organization:
>Environment:
9-STABLE amd64
>Description:
If WITH_CLANG_IS_CC= is set in src.conf, /usr/bin/cpp is clang, and configure fails:

checking for cpp... /usr/bin/cpp
checking if /usr/bin/cpp requires -undef... yes
checking if /usr/bin/cpp requires -traditional... configure: error: /usr/bin/cpp does not preserve whitespace with or without -traditional.  I don't know what to do.
===>  Script "configure" failed unexpectedly.
Please report the problem to x11@FreeBSD.org [maintainer] and attach the
"/usr/obj/usr/ports/x11/libX11/work/libX11-1.4.4/config.log" including the
output of the failure of your make command. Also, it might be a good idea to
provide an overview of all packages installed on your system (e.g. an `ls
/var/db/pkg`).
*** Error code 1
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-x11 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Mar 24 13:20:18 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: Jan Beich <jbeich@tormail.org>
To: Jakub Lach <jakub_lach@mailplus.pl>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/166373: [x11] x11/libX11 fails if /usr/bin/cpp is clang
Date: Tue, 01 May 2012 08:47:26 +0300

 --=-=-=
 Content-Type: text/plain
 
 Here's a template fix. Xserver likely needs similar patch.
 
   # if you already have lang/gcc installed
   $ echo RAWCPP=/usr/local/bin/cpp46 >>Makefile.local
   $ make install
   
 
 --=-=-=
 Content-Type: text/x-patch
 Content-Disposition: attachment; filename=clang.diff
 
 Index: x11/libX11/Makefile
 ===================================================================
 RCS file: /a/.csup/ports/x11/libX11/Makefile,v
 retrieving revision 1.40
 diff -u -p -r1.40 Makefile
 --- x11/libX11/Makefile	9 Nov 2011 15:25:48 -0000	1.40
 +++ x11/libX11/Makefile	1 May 2012 05:32:03 -0000
 @@ -25,12 +25,21 @@ USE_XORG=	bigreqsproto xau xcmiscproto x
  CONFIGURE_ARGS+=	--datadir=${PREFIX}/lib \
  			--without-xmlto \
  			--disable-specs
 -CONFIGURE_ENV+=	ac_cv_path_PS2PDF=""
 +CONFIGURE_ENV+=	RAWCPP="${RAWCPP}" ac_cv_path_PS2PDF=""
  
  .include "${.CURDIR}/manpages"
  
 +.include <bsd.port.pre.mk>
 +
 +.if ${CPP:Mclang*}
 +RAWCPP?=	${LOCALBASE}/bin/ucpp
 +BUILD_DEPENDS+=	${RAWCPP}:${PORTSDIR}/devel/ucpp
 +.else
 +RAWCPP?=	$$(command -v ${CPP})
 +.endif
 +
  post-patch:
  	@${REINPLACE_CMD} '/^install-data-am:/,/^$$/ \
  		s/install-specDATA//' ${WRKSRC}/nls/Makefile.in
  
 -.include <bsd.port.mk>
 +.include <bsd.port.post.mk>
 
 --=-=-=--

From: Niclas Zeising <zeising@daemonic.se>
To: bug-followup@FreeBSD.org, jakub_lach@mailplus.pl
Cc:  
Subject: Re: ports/166373: x11/libX11 fails if /usr/bin/cpp is clang
Date: Sun, 27 May 2012 17:28:13 +0200

 A patch has been committed to the xorg development repository[1].  This
 issue is being worked on and will hopefully be resolved soon.
 Regards!
 -- 
 Niclas Zeising
 
 [1]  https://trillian.chruetertee.ch/svn/ports/trunk
State-Changed-From-To: open->analyzed 
State-Changed-By: kwm 
State-Changed-When: Sun May 27 15:35:33 UTC 2012 
State-Changed-Why:  


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

From: Jan Beich <jbeich@tormail.org>
To: Jakub Lach <jakub_lach@mailplus.pl>
Cc: bug-followup@FreeBSD.org, Niclas Zeising <zeising@daemonic.se>
Subject: Re: ports/166373: [x11] x11/libX11 fails if /usr/bin/cpp is clang
Date: Fri, 01 Jun 2012 09:55:57 -0300

 --=-=-=
 Content-Type: text/plain
 Content-Disposition: inline
 
 I reconsider, ucpp is buggy compared to clang-cpp. Here is an example of
 broken en_US.UTF-8 locale: http://ompldr.org/vZTFvaQ/xterm.png
 
   # affects a few non-unicode locales, e.g. zh_TW.big5
   $ printf '\\xaa\\xab' | ucpp | sed '/^#/d; /^$/d'
   \xaaxab
   $ printf '\\xaa\\xab' | cpp46 | sed '/^#/d; /^$/d'
   \xaa\xab
 
   # affects locale.alias
   $ printf "#if 0\nfo'o\n#endif\nbar\n" | ucpp | sed '/^#/d; /^$/d'
   <stdin>: line 2: truncated token
   <stdin>: line 5: unterminated #if construction (depth 1)
   $ printf "#if 0\nfo'o\n#endif\nbar\n" | cpp46 | sed '/^#/d; /^$/d'
   <stdin>:2:3: warning: missing terminating ' character [enabled by default]
   bar
 
 A quick diff(1) in nls/ directory showed only whitespace difference
 between cpp46 and clang-cpp for me.
 
   # autoconf assumes -traditional is only for whitespace
   $ echo ftp://localhost | clang-cpp | sed '/^#/d; /^$/d'
   ftp:
   $ echo ftp://localhost | clang-cpp -traditional | sed '/^#/d; /^$/d'
   ftp://localhost
 
 
 --=-=-=
 Content-Type: text/x-patch
 Content-Disposition: attachment; filename=cpp.diff
 
 Index: x11/libX11/Makefile
 ===================================================================
 --- x11/libX11/Makefile	(revision 505)
 +++ x11/libX11/Makefile	(working copy)
 @@ -15,8 +15,7 @@ COMMENT=	X11 library
  
  LICENSE=	MIT
  
 -BUILD_DEPENDS+=	ucpp:${PORTSDIR}/devel/ucpp \
 -		${LOCALBASE}/libdata/pkgconfig/xcb.pc:${PORTSDIR}/x11/libxcb \
 +BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/xcb.pc:${PORTSDIR}/x11/libxcb \
  		${LOCALBASE}/share/aclocal/xorg-macros.m4:${PORTSDIR}/devel/xorg-macros
  RUN_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/xcb.pc:${PORTSDIR}/x11/libxcb
  
 @@ -26,11 +25,13 @@ USE_XORG=	bigreqsproto xau xcmiscproto xdmcp xextp
  CONFIGURE_ARGS+=	--datadir=${PREFIX}/lib \
  			--without-xmlto \
  			--disable-specs
 -CONFIGURE_ENV+=	RAWCPP="${LOCALBASE}/bin/ucpp" ac_cv_path_PS2PDF=""
 +CONFIGURE_ENV+=	ac_cv_path="${CPP}" ac_cv_path_PS2PDF=""
  
  .include "${.CURDIR}/manpages"
  
  post-patch:
 +	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
 +		${WRKSRC}/configure
  	@${REINPLACE_CMD} '/^install-data-am:/,/^$$/ \
  		s/install-specDATA//' ${WRKSRC}/nls/Makefile.in
  
 
 --=-=-=--

From: Jan Beich <jbeich@tormail.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/166373: [x11] x11/libX11 fails if /usr/bin/cpp is clang
Date: Fri, 01 Jun 2012 23:06:27 +1000

 > +CONFIGURE_ENV+=	ac_cv_path="${CPP}" ac_cv_path_PS2PDF=""
                         ^^^^^^^^^^^^^^^^^^
 Oops, this is supposed to be ac_cv_path_RAWCPP but no one cares
 about respecting CPP, anyway.

From: Niclas Zeising <zeising@daemonic.se>
To: Jan Beich <jbeich@tormail.org>
Cc: Jakub Lach <jakub_lach@mailplus.pl>, bug-followup@FreeBSD.org
Subject: Re: ports/166373: [x11] x11/libX11 fails if /usr/bin/cpp is clang
Date: Sat, 02 Jun 2012 10:44:16 +0200

 It is noted.  I have however, not had time to work on it more last week.
  Hopefully things clear up in the week to come.

From: Niclas Zeising <zeising@daemonic.se>
To: bug-followup@FreeBSD.org, jakub_lach@mailplus.pl
Cc:  
Subject: Re: ports/166373: x11/libX11 fails if /usr/bin/cpp is clang
Date: Thu, 21 Jun 2012 22:32:13 +0200

 A new patch is in the xorg development repository[1]. Hopefully it will
 work better. Please test it so we can resolve this issue.
 Regards!
 -- 
 Niclas
 
 [1] https://trillian.chruetertee.ch/svn/ports/trunk
State-Changed-From-To: analyzed->suspended 
State-Changed-By: linimon 
State-Changed-When: Fri Jun 22 02:37:10 UTC 2012 
State-Changed-Why:  
From misfiled PR ports/169310: 

Date: Fri, 22 Jun 2012 00:35:26 +0200 
From: =?UTF-8?Q?Jakub_Lach?= <jakub_lach@mailplus.pl> 
To: bug-followup@FreeBSD.org 
Subject: =?UTF-8?Q?Re:_ports/166373:_x11/libX11_fails?= 
=?UTF-8?Q?_if_/usr/bin/cpp_is_clang?= 

Recompiled x11/libX11 from trunk without problems now. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/166373: commit references a PR
Date: Sun, 29 Jul 2012 18:26:14 +0000 (UTC)

 Author: zeising
 Date: Sun Jul 29 18:26:00 2012
 New Revision: 301687
 URL: http://svn.freebsd.org/changeset/ports/301687
 
 Log:
   Fix the build of xorg related ports when the base system is compiled with
   clang as system compiler and cpp is clang cpp (as opposed to GNU cpp).
   This is done by removing the configure test for cpp completely.  Using
   clang cpp will make some manual pages as well as some scripts get slightly
   wierd whitespace formatting.  However, it does not affect the function of
   the scripts or the instructions in the manual pages.
   
   PR:             ports/166373
   Submitted by:   Jakub Lach <jakub_lach@mailplus.pl> (PR)
   Patch by:       me (with ideas from PR and mailing list)
   Tested by:      Jakub Lach <jakub_lach@mailplus.pl>, me
   Approved by:    kwm (mentor)
   Obtained from:  xorg staging area
 
 Modified:
   head/x11-drivers/xf86-video-sis/Makefile
   head/x11-servers/xorg-server/Makefile
   head/x11-toolkits/libXt/Makefile
   head/x11/libX11/Makefile
   head/x11/xinit/Makefile
 
 Modified: head/x11-drivers/xf86-video-sis/Makefile
 ==============================================================================
 --- head/x11-drivers/xf86-video-sis/Makefile	Sun Jul 29 17:32:50 2012	(r301686)
 +++ head/x11-drivers/xf86-video-sis/Makefile	Sun Jul 29 18:26:00 2012	(r301687)
 @@ -20,4 +20,8 @@ XORG_CAT=	driver
  USE_XORG=	xf86dgaproto xf86driproto xineramaproto videoproto xf86miscproto xextproto glproto
  MAN4=		sis.4x
  
 +post-patch:
 +	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
 +		${WRKSRC}/configure
 +	
  .include <bsd.port.mk>
 
 Modified: head/x11-servers/xorg-server/Makefile
 ==============================================================================
 --- head/x11-servers/xorg-server/Makefile	Sun Jul 29 17:32:50 2012	(r301686)
 +++ head/x11-servers/xorg-server/Makefile	Sun Jul 29 18:26:00 2012	(r301687)
 @@ -148,6 +148,10 @@ pre-everything::
  	@${ECHO_MSG} "xorg-server_UNSET=SUID in /etc/make.conf."
  .endif
  
 +post-patch:
 +	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
 +		${WRKSRC}/configure
 +
  .if defined(WITH_NEW_XORG)
  post-install:
  	@${MKDIR} ${PREFIX}/share/X11/xorg.conf.d
 
 Modified: head/x11-toolkits/libXt/Makefile
 ==============================================================================
 --- head/x11-toolkits/libXt/Makefile	Sun Jul 29 17:32:50 2012	(r301686)
 +++ head/x11-toolkits/libXt/Makefile	Sun Jul 29 18:26:00 2012	(r301687)
 @@ -285,4 +285,8 @@ MAN3=	MenuPopdown.3 \
  	XtWindowOfObject.3 \
  	XtWindowToWidget.3
  
 +post-patch:
 +	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
 +		${WRKSRC}/configure
 +
  .include <bsd.port.mk>
 
 Modified: head/x11/libX11/Makefile
 ==============================================================================
 --- head/x11/libX11/Makefile	Sun Jul 29 17:32:50 2012	(r301686)
 +++ head/x11/libX11/Makefile	Sun Jul 29 18:26:00 2012	(r301687)
 @@ -22,6 +22,7 @@ RUN_DEPENDS+=	${LOCALBASE}/libdata/pkgco
  XORG_CAT=	lib
  USE_XORG=	bigreqsproto xau xcmiscproto xdmcp xextproto xtrans \
  		kbproto:both inputproto xf86bigfontproto xproto:both
 +
  CONFIGURE_ARGS+=	--datadir=${PREFIX}/lib \
  			--without-xmlto \
  			--disable-specs
 @@ -30,6 +31,8 @@ CONFIGURE_ENV+=	ac_cv_path_PS2PDF=""
  .include "${.CURDIR}/manpages"
  
  post-patch:
 +	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
 +		${WRKSRC}/configure
  	@${REINPLACE_CMD} '/^install-data-am:/,/^$$/ \
  		s/install-specDATA//' ${WRKSRC}/nls/Makefile.in
  
 
 Modified: head/x11/xinit/Makefile
 ==============================================================================
 --- head/x11/xinit/Makefile	Sun Jul 29 17:32:50 2012	(r301686)
 +++ head/x11/xinit/Makefile	Sun Jul 29 18:26:00 2012	(r301687)
 @@ -24,6 +24,7 @@ PLIST_DIRS=	lib/X11/xinit
  MAN1=		startx.1 xinit.1
  
  post-patch:
 +	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' ${WRKSRC}/configure
  	@${REINPLACE_CMD} -e 's|hexdump|/usr/bin/hexdump|' ${WRKSRC}/startx.cpp
  	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${WRKSRC}/man/xinit.man
  
 _______________________________________________
 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"
 
State-Changed-From-To: suspended->closed 
State-Changed-By: zeising 
State-Changed-When: Sun Jul 29 18:56:13 UTC 2012 
State-Changed-Why:  
The fix in the xorg staging area was merged to the regular ports tree. 
Thanks for all help in resolving this! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166373 
>Unformatted:
