From tkato432@yahoo.com  Mon Mar 31 18:30:43 2014
Return-Path: <tkato432@yahoo.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 87C2BFFF
	for <FreeBSD-gnats-submit@FreeBSD.org>; Mon, 31 Mar 2014 18:30:43 +0000 (UTC)
Received: from omta01.auone-net.jp (mail-or1-f17.auone-net.jp [106.187.231.17])
	by mx1.freebsd.org (Postfix) with ESMTP id 48343358
	for <FreeBSD-gnats-submit@FreeBSD.org>; Mon, 31 Mar 2014 18:30:43 +0000 (UTC)
Received: from coppermine.my.domain (ZT030154.ppp.dion.ne.jp [59.128.30.154])
	by omta01.auone-net.jp (au one net mail) with ESMTP id 63D5498000F
	for <FreeBSD-gnats-submit@FreeBSD.org>; Tue,  1 Apr 2014 03:30:38 +0900 (JST)
Message-Id: <20140401032622.bf3738f5fc6b64a32790fdb3@yahoo.com>
Date: Tue, 1 Apr 2014 03:26:22 +0900
From: KATO Tsuguru <tkato432@yahoo.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Subject: graphics/grx: Fix build on i386 with clang

>Number:         188139
>Category:       ports
>Synopsis:       graphics/grx: Fix build on i386 with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 31 18:40:01 UTC 2014
>Closed-Date:    Sun May 18 04:59:14 UTC 2014
>Last-Modified:  Sun May 18 05:00:01 UTC 2014
>Originator:     KATO Tsuguru
>Release:        FreeBSD 8.4-RELEASE-p7 i386
>Organization:
>Environment:
>Description:
- Fix build on i386 with clang

New file:
files/patch-src__fdrivers__driver16.h
files/patch-src__include__arith.h
files/patch-src__include__memcopy.h
files/patch-src__include__memfill.h
files/patch-src__include__memmode.h
files/patch-src__include__mempeek.h
files/patch-src__utils__shiftscl.c

>How-To-Repeat:
>Fix:

diff -urN /usr/ports/graphics/grx/Makefile graphics/grx/Makefile
--- /usr/ports/graphics/grx/Makefile	2014-02-02 01:56:03.000000000 +0900
+++ graphics/grx/Makefile	2014-04-01 00:00:00.000000000 +0900
@@ -8,20 +8,13 @@
 DISTNAME=	${PORTNAME}${PORTVERSION:S/.//g}
 
 MAINTAINER=	ports@FreeBSD.org
-COMMENT=	A 2D graphics library
+COMMENT=	2D graphics library
 
 LICENSE=	LGPL20 MIT
 LICENSE_COMB=	multi
 
-LIB_DEPENDS=	pthread-stubs:${PORTSDIR}/devel/libpthread-stubs
-
-OPTIONS_DEFINE=	BGI BMP JPEG PNG PRINT TIFF ZLIB
-OPTIONS_DEFAULT=	ZLIB BGI BMP PNG PRINT
-BGI_DESC=	Enable BGI support
-BMP_DESC=	Enable BMP support
-
-USE_XORG=	x11 xau xcb xdmcp
 USES=		gmake
+USE_XORG=	x11 xau xcb xdmcp
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	--prefix=${PREFIX} --with-fontpath=${DATADIR}/fonts \
 		--with-x11-base=${LOCALBASE}
@@ -36,59 +29,29 @@
 
 INFO=		grx
 
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MBGI}
-CONFIGURE_ARGS+=--enable-bgi
-PLIST_SUB+=	BGI=""
-.else
-CONFIGURE_ARGS+=--disable-bgi
-PLIST_SUB+=	BGI="@comment "
-.endif
-
-.if ${PORT_OPTIONS:MBMP}
-CONFIGURE_ARGS+=--enable-bmp
-.else
-CONFIGURE_ARGS+=--disable-bmp
-.endif
-
-.if ${PORT_OPTIONS:MJPEG}
-LIB_DEPENDS+=	jpeg:${PORTSDIR}/graphics/jpeg
-CONFIGURE_ARGS+=--enable-jpeg
-.else
-CONFIGURE_ARGS+=--disable-jpeg
-.endif
+OPTIONS_DEFINE=		BGI BMP JPEG PNG PRINT TIFF ZLIB
+OPTIONS_DEFAULT=	BGI BMP PNG PRINT ZLIB
+OPTIONS_SUB=		yes
+
+BGI_DESC=		BGI image format support
+BGI_CONFIGURE_ENABLE=	bgi
+BMP_DESC=		BMP image format support
+BMP_CONFIGURE_ENABLE=	bmp
+JPEG_LIB_DEPENDS+=	libjpeg.so:${PORTSDIR}/graphics/jpeg
+JPEG_CONFIGURE_ENABLE=	jpeg
+PNG_LIB_DEPENDS=	libpng15.so:${PORTSDIR}/graphics/png
+PNG_CONFIGURE_ENABLE=	png
+PRINT_CONFIGURE_ENABLE=	print
+TIFF_LIB_DEPENDS=	libtiff.so:${PORTSDIR}/graphics/tiff
+TIFF_CONFIGURE_ENABLE=	tiff
+ZLIB_CONFIGURE_ENABLE=	zlib
 
-.if ${PORT_OPTIONS:MPNG}
-LIB_DEPENDS+=	png15:${PORTSDIR}/graphics/png
-CONFIGURE_ARGS+=--enable-png
-.else
-CONFIGURE_ARGS+=--disable-png
-.endif
-
-.if ${PORT_OPTIONS:MPRINT}
-CONFIGURE_ARGS+=--enable-print
-PLIST_SUB+=	PRINT=""
-.else
-CONFIGURE_ARGS+=--disable-print
-PLIST_SUB+=	PRINT="@comment "
-.endif
-
-.if ${PORT_OPTIONS:MTIFF}
-LIB_DEPENDS+=	tiff:${PORTSDIR}/graphics/tiff
-CONFIGURE_ARGS+=--enable-tiff
-.else
-CONFIGURE_ARGS+=--disable-tiff
-.endif
+.include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MZLIB} || !empty(PORT_OPTIONS:MPNG)
-CONFIGURE_ARGS+=--enable-zlib
-.else
-CONFIGURE_ARGS+=--disable-zlib
+.if ${PORT_OPTIONS:MPNG} && empty(PORT_OPTIONS:MZLIB)
+IGNORE=		PNG support requires ZLIB support
 .endif
 
-.include <bsd.port.pre.mk>
-
 .if ${ARCH} == "amd64"
 CONFIGURE_ARGS+=--enable-x86_64
 .endif
@@ -100,17 +63,18 @@
 post-patch:
 	@${GREP} -ERl '<(malloc|alloca)\.h>' ${WRKSRC} | ${XARGS} \
 		${REINPLACE_CMD} -Ee 's|<(malloc\|alloca)\.h>|<stdlib.h>|'
-	@${REINPLACE_CMD} -Ee \
-		's|-m32|| ; \
+	@${REINPLACE_CMD} -e \
+		's|^\(CC[[:blank:]]*=\).*|\1 ${CC}| ; \
+		 s|^\(STRIP[[:blank:]]*=\).*|\1 ${TRUE}| ; \
+		 s|^\(CCOPT[[:blank:]]*=\).*|\1 ${CPPFLAGS} ${CFLAGS}| ; \
+		 s|^\(LDOPT[[:blank:]]*=\).*|\1 ${LDFLAGS}| ; \
 		 s|-m64|| ; \
-		 s|^(CC[[:blank:]]*=).*|\1 ${CC}| ; \
-		 s|^(CCOPT =)|\1 ${CPPFLAGS} ${CFLAGS}| ; \
-		 s|^(LDOPT =)|\1 ${LDFLAGS}| ; \
-		 s|lib64|lib|' \
+		 s|-m32||' \
 		${WRKSRC}/makedefs.grx
-	@${REINPLACE_CMD} -e \
-		's|gcc|${CC}| ; \
-		 s|lib64|lib|' \
-		${WRKSRC}/src/makefile.[lx]*
 
-.include <bsd.port.post.mk>
+post-install:
+.for i in bin2c fnt2c xmodetest
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${i}
+.endfor
+
+.include <bsd.port.mk>
diff -urN /usr/ports/graphics/grx/files/patch-src__fdrivers__driver16.h graphics/grx/files/patch-src__fdrivers__driver16.h
--- /usr/ports/graphics/grx/files/patch-src__fdrivers__driver16.h	1970-01-01 09:00:00.000000000 +0900
+++ graphics/grx/files/patch-src__fdrivers__driver16.h	2014-04-01 00:00:00.000000000 +0900
@@ -0,0 +1,36 @@
+--- src/fdrivers/driver16.h.orig
++++ src/fdrivers/driver16.h
+@@ -46,7 +46,7 @@
+ # define repfill16_and   repfill_w_f_and
+ # define repfill16       repfill_w_f
+ # define SETFARSEL(sel)  setup_far_selector(sel)
+-# if defined(__GNUC__) && defined(__i386__)
++# if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
+ #   define ASM_386_SEL   I386_GCC_FAR_SELECTOR
+ # endif /* GCC i386 */
+ #else /* defined FAR_ACCESS */
+@@ -180,7 +180,7 @@
+     GRX_LEAVE();
+ }
+ 
+-#if defined(__GNUC__) && defined(__i386__)
++#if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
+ static void drawline(int x,int y,int dx,int dy,GrColor color)
+ {
+     struct {
+@@ -196,6 +196,7 @@
+ 
+ #   ifdef __GNUC__
+ #   ifdef __i386__
++#   ifndef __clang__
+ #   define ASM_LINE1(OPC) asm volatile(""              \
+ 	"   .align 2,0x90                      \n"     \
+ 	"0: "#OPC"w %6,"ASM_386_SEL"(%0)       \n"     \
+@@ -236,6 +237,7 @@
+ 	)
+ #   endif
+ #   endif
++#   endif
+ 
+     if(dy < 0) {
+ 	y -= (dy = (-dy));
diff -urN /usr/ports/graphics/grx/files/patch-src__include__arith.h graphics/grx/files/patch-src__include__arith.h
--- /usr/ports/graphics/grx/files/patch-src__include__arith.h	1970-01-01 09:00:00.000000000 +0900
+++ graphics/grx/files/patch-src__include__arith.h	2014-04-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/include/arith.h.orig
++++ src/include/arith.h
+@@ -22,7 +22,7 @@
+ #ifndef __ARITH_H_INCLUDED__
+ #define __ARITH_H_INCLUDED__
+ 
+-#ifdef __GNUC__
++#if defined(__GNUC__) && !defined(__clang__)
+ #include "gcc/arith.h"
+ #elif defined(__TURBOC__)
+ #include "bcc/arith.h"
diff -urN /usr/ports/graphics/grx/files/patch-src__include__memcopy.h graphics/grx/files/patch-src__include__memcopy.h
--- /usr/ports/graphics/grx/files/patch-src__include__memcopy.h	1970-01-01 09:00:00.000000000 +0900
+++ graphics/grx/files/patch-src__include__memcopy.h	2014-04-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/include/memcopy.h.orig
++++ src/include/memcopy.h
+@@ -44,7 +44,7 @@
+ #define CPSIZE_h     sizeof(GR_int64)
+ #endif
+ 
+-#ifdef __GNUC__
++#if defined(__GNUC__) && !defined(__clang__)
+ #  include "gcc/memcopy.h"
+ #elif defined(__TURBOC__)
+ #  include "bcc/memcopy.h"
diff -urN /usr/ports/graphics/grx/files/patch-src__include__memfill.h graphics/grx/files/patch-src__include__memfill.h
--- /usr/ports/graphics/grx/files/patch-src__include__memfill.h	1970-01-01 09:00:00.000000000 +0900
+++ graphics/grx/files/patch-src__include__memfill.h	2014-04-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/include/memfill.h.orig
++++ src/include/memfill.h
+@@ -32,7 +32,7 @@
+ #include "arith.h"
+ #endif
+ 
+-#ifdef __GNUC__
++#if defined(__GNUC__) && !defined(__clang__)
+ #  include "gcc/memfill.h"
+ #elif defined(__TURBOC__)
+ #  include "bcc/memfill.h"
diff -urN /usr/ports/graphics/grx/files/patch-src__include__memmode.h graphics/grx/files/patch-src__include__memmode.h
--- /usr/ports/graphics/grx/files/patch-src__include__memmode.h	1970-01-01 09:00:00.000000000 +0900
+++ graphics/grx/files/patch-src__include__memmode.h	2014-04-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/include/memmode.h.orig
++++ src/include/memmode.h
+@@ -19,7 +19,7 @@
+ #ifndef  __MEMMODE_H_INCLUDED__
+ #define  __MEMMODE_H_INCLUDED__
+ 
+-#ifdef __GNUC__
++#if defined(__GNUC__) && !defined(__clang__)
+ #include "gcc/memmode.h"
+ #elif defined(__TURBOC__)
+ #include "bcc/memmode.h"
diff -urN /usr/ports/graphics/grx/files/patch-src__include__mempeek.h graphics/grx/files/patch-src__include__mempeek.h
--- /usr/ports/graphics/grx/files/patch-src__include__mempeek.h	1970-01-01 09:00:00.000000000 +0900
+++ graphics/grx/files/patch-src__include__mempeek.h	2014-04-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/include/mempeek.h.orig
++++ src/include/mempeek.h
+@@ -29,7 +29,7 @@
+ #include "memmode.h"
+ #endif
+ 
+-#ifdef __GNUC__
++#if defined(__GNUC__) && !defined(__clang__)
+ #include "gcc/mempeek.h"
+ #elif defined(__TURBOC__)
+ #include "bcc/mempeek.h"
diff -urN /usr/ports/graphics/grx/files/patch-src__utils__shiftscl.c graphics/grx/files/patch-src__utils__shiftscl.c
--- /usr/ports/graphics/grx/files/patch-src__utils__shiftscl.c	1970-01-01 09:00:00.000000000 +0900
+++ graphics/grx/files/patch-src__utils__shiftscl.c	2014-04-01 00:00:00.000000000 +0900
@@ -0,0 +1,20 @@
+--- src/utils/shiftscl.c.orig
++++ src/utils/shiftscl.c
+@@ -34,7 +34,7 @@
+     for (plane = 0; plane < planes; ++plane) {
+       GR_int8u far *s = *(src++) + ws;
+       GR_int8u far *d = *(dst++) + ws;
+-#     if defined(__GNUC__) && defined(__i386__)
++#     if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
+ 	int _dummy_, w = ws;
+ 	/* sad but true: the x86 bytesex forces this inefficient code :( */
+ 	asm volatile ("\n"
+@@ -91,7 +91,7 @@
+     for (plane = 0; plane < planes; ++plane) {
+       GR_int8u far *s = *(src++);
+       GR_int8u far *d = *(dst++);
+-#     if defined(__GNUC__) && defined(__i386__)
++#     if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
+ 	int _dummy_, w = ws;
+ 	asm volatile ("\n"
+ 	  "   movb    (%0),%%ch    \n"
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Mar 31 18:40:06 UTC 2014 
Responsible-Changed-Why:  
miwi@ wants this submitter's PRs (via the GNATS Auto Assign Tool) 

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

From: KATO Tsuguru <tkato432@yahoo.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/188139: graphics/grx: Fix build on i386 with clang
Date: Fri, 18 Apr 2014 02:51:03 +0900

 This is a multi-part message in MIME format.
 
 --Multipart=_Fri__18_Apr_2014_02_51_03_+0900_Axtq+HybA7xy0WuY
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 
 Remake of the patch against current tree.
 
 --Multipart=_Fri__18_Apr_2014_02_51_03_+0900_Axtq+HybA7xy0WuY
 Content-Type: text/x-diff;
  name="graphics_grx.diff"
 Content-Disposition: attachment;
  filename="graphics_grx.diff"
 Content-Transfer-Encoding: 7bit
 
 diff -urN /usr/ports/graphics/grx/Makefile graphics/grx/Makefile
 --- /usr/ports/graphics/grx/Makefile	2014-04-17 08:02:20.000000000 +0900
 +++ graphics/grx/Makefile	2014-04-18 00:00:00.000000000 +0900
 @@ -9,20 +9,13 @@
  DISTNAME=	${PORTNAME}${PORTVERSION:S/.//g}
  
  MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	A 2D graphics library
 +COMMENT=	2D graphics library
  
  LICENSE=	LGPL20 MIT
  LICENSE_COMB=	multi
  
 -LIB_DEPENDS=	pthread-stubs:${PORTSDIR}/devel/libpthread-stubs
 -
 -OPTIONS_DEFINE=	BGI BMP JPEG PNG PRINT TIFF ZLIB
 -OPTIONS_DEFAULT=	ZLIB BGI BMP PNG PRINT
 -BGI_DESC=	Enable BGI support
 -BMP_DESC=	Enable BMP support
 -
 -USE_XORG=	x11 xau xcb xdmcp
  USES=		gmake
 +USE_XORG=	x11 xau xcb xdmcp
  HAS_CONFIGURE=	yes
  CONFIGURE_ARGS=	--prefix=${PREFIX} --with-fontpath=${DATADIR}/fonts \
  		--with-x11-base=${LOCALBASE}
 @@ -37,59 +30,29 @@
  
  INFO=		grx
  
 -.include <bsd.port.options.mk>
 -
 -.if ${PORT_OPTIONS:MBGI}
 -CONFIGURE_ARGS+=--enable-bgi
 -PLIST_SUB+=	BGI=""
 -.else
 -CONFIGURE_ARGS+=--disable-bgi
 -PLIST_SUB+=	BGI="@comment "
 -.endif
 -
 -.if ${PORT_OPTIONS:MBMP}
 -CONFIGURE_ARGS+=--enable-bmp
 -.else
 -CONFIGURE_ARGS+=--disable-bmp
 -.endif
 -
 -.if ${PORT_OPTIONS:MJPEG}
 -LIB_DEPENDS+=	jpeg:${PORTSDIR}/graphics/jpeg
 -CONFIGURE_ARGS+=--enable-jpeg
 -.else
 -CONFIGURE_ARGS+=--disable-jpeg
 -.endif
 +OPTIONS_DEFINE=		BGI BMP JPEG PNG PRINT TIFF ZLIB
 +OPTIONS_DEFAULT=	BGI BMP PNG PRINT ZLIB
 +OPTIONS_SUB=		yes
 +
 +BGI_DESC=		BGI image format support
 +BGI_CONFIGURE_ENABLE=	bgi
 +BMP_DESC=		BMP image format support
 +BMP_CONFIGURE_ENABLE=	bmp
 +JPEG_LIB_DEPENDS+=	libjpeg.so:${PORTSDIR}/graphics/jpeg
 +JPEG_CONFIGURE_ENABLE=	jpeg
 +PNG_LIB_DEPENDS=	libpng15.so:${PORTSDIR}/graphics/png
 +PNG_CONFIGURE_ENABLE=	png
 +PRINT_CONFIGURE_ENABLE=	print
 +TIFF_LIB_DEPENDS=	libtiff.so:${PORTSDIR}/graphics/tiff
 +TIFF_CONFIGURE_ENABLE=	tiff
 +ZLIB_CONFIGURE_ENABLE=	zlib
  
 -.if ${PORT_OPTIONS:MPNG}
 -LIB_DEPENDS+=	png15:${PORTSDIR}/graphics/png
 -CONFIGURE_ARGS+=--enable-png
 -.else
 -CONFIGURE_ARGS+=--disable-png
 -.endif
 -
 -.if ${PORT_OPTIONS:MPRINT}
 -CONFIGURE_ARGS+=--enable-print
 -PLIST_SUB+=	PRINT=""
 -.else
 -CONFIGURE_ARGS+=--disable-print
 -PLIST_SUB+=	PRINT="@comment "
 -.endif
 -
 -.if ${PORT_OPTIONS:MTIFF}
 -LIB_DEPENDS+=	tiff:${PORTSDIR}/graphics/tiff
 -CONFIGURE_ARGS+=--enable-tiff
 -.else
 -CONFIGURE_ARGS+=--disable-tiff
 -.endif
 +.include <bsd.port.options.mk>
  
 -.if ${PORT_OPTIONS:MZLIB} || !empty(PORT_OPTIONS:MPNG)
 -CONFIGURE_ARGS+=--enable-zlib
 -.else
 -CONFIGURE_ARGS+=--disable-zlib
 +.if ${PORT_OPTIONS:MPNG} && empty(PORT_OPTIONS:MZLIB)
 +IGNORE=		PNG support requires ZLIB support
  .endif
  
 -.include <bsd.port.pre.mk>
 -
  .if ${ARCH} == "amd64"
  CONFIGURE_ARGS+=--enable-x86_64
  .endif
 @@ -101,17 +64,18 @@
  post-patch:
  	@${GREP} -ERl '<(malloc|alloca)\.h>' ${WRKSRC} | ${XARGS} \
  		${REINPLACE_CMD} -Ee 's|<(malloc\|alloca)\.h>|<stdlib.h>|'
 -	@${REINPLACE_CMD} -Ee \
 -		's|-m32|| ; \
 +	@${REINPLACE_CMD} -e \
 +		's|^\(CC[[:blank:]]*=\).*|\1 ${CC}| ; \
 +		 s|^\(STRIP[[:blank:]]*=\).*|\1 ${TRUE}| ; \
 +		 s|^\(CCOPT[[:blank:]]*=\).*|\1 ${CPPFLAGS} ${CFLAGS}| ; \
 +		 s|^\(LDOPT[[:blank:]]*=\).*|\1 ${LDFLAGS}| ; \
  		 s|-m64|| ; \
 -		 s|^(CC[[:blank:]]*=).*|\1 ${CC}| ; \
 -		 s|^(CCOPT =)|\1 ${CPPFLAGS} ${CFLAGS}| ; \
 -		 s|^(LDOPT =)|\1 ${LDFLAGS}| ; \
 -		 s|lib64|lib|' \
 +		 s|-m32||' \
  		${WRKSRC}/makedefs.grx
 -	@${REINPLACE_CMD} -e \
 -		's|gcc|${CC}| ; \
 -		 s|lib64|lib|' \
 -		${WRKSRC}/src/makefile.[lx]*
  
 -.include <bsd.port.post.mk>
 +post-install:
 +.for i in bin2c fnt2c xmodetest
 +	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${i}
 +.endfor
 +
 +.include <bsd.port.mk>
 diff -urN /usr/ports/graphics/grx/files/patch-src__fdrivers__driver16.h graphics/grx/files/patch-src__fdrivers__driver16.h
 --- /usr/ports/graphics/grx/files/patch-src__fdrivers__driver16.h	1970-01-01 09:00:00.000000000 +0900
 +++ graphics/grx/files/patch-src__fdrivers__driver16.h	2014-04-18 00:00:00.000000000 +0900
 @@ -0,0 +1,36 @@
 +--- src/fdrivers/driver16.h.orig
 ++++ src/fdrivers/driver16.h
 +@@ -46,7 +46,7 @@
 + # define repfill16_and   repfill_w_f_and
 + # define repfill16       repfill_w_f
 + # define SETFARSEL(sel)  setup_far_selector(sel)
 +-# if defined(__GNUC__) && defined(__i386__)
 ++# if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + #   define ASM_386_SEL   I386_GCC_FAR_SELECTOR
 + # endif /* GCC i386 */
 + #else /* defined FAR_ACCESS */
 +@@ -180,7 +180,7 @@
 +     GRX_LEAVE();
 + }
 + 
 +-#if defined(__GNUC__) && defined(__i386__)
 ++#if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + static void drawline(int x,int y,int dx,int dy,GrColor color)
 + {
 +     struct {
 +@@ -196,6 +196,7 @@
 + 
 + #   ifdef __GNUC__
 + #   ifdef __i386__
 ++#   ifndef __clang__
 + #   define ASM_LINE1(OPC) asm volatile(""              \
 + 	"   .align 2,0x90                      \n"     \
 + 	"0: "#OPC"w %6,"ASM_386_SEL"(%0)       \n"     \
 +@@ -236,6 +237,7 @@
 + 	)
 + #   endif
 + #   endif
 ++#   endif
 + 
 +     if(dy < 0) {
 + 	y -= (dy = (-dy));
 diff -urN /usr/ports/graphics/grx/files/patch-src__include__arith.h graphics/grx/files/patch-src__include__arith.h
 --- /usr/ports/graphics/grx/files/patch-src__include__arith.h	1970-01-01 09:00:00.000000000 +0900
 +++ graphics/grx/files/patch-src__include__arith.h	2014-04-18 00:00:00.000000000 +0900
 @@ -0,0 +1,11 @@
 +--- src/include/arith.h.orig
 ++++ src/include/arith.h
 +@@ -22,7 +22,7 @@
 + #ifndef __ARITH_H_INCLUDED__
 + #define __ARITH_H_INCLUDED__
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #include "gcc/arith.h"
 + #elif defined(__TURBOC__)
 + #include "bcc/arith.h"
 diff -urN /usr/ports/graphics/grx/files/patch-src__include__memcopy.h graphics/grx/files/patch-src__include__memcopy.h
 --- /usr/ports/graphics/grx/files/patch-src__include__memcopy.h	1970-01-01 09:00:00.000000000 +0900
 +++ graphics/grx/files/patch-src__include__memcopy.h	2014-04-18 00:00:00.000000000 +0900
 @@ -0,0 +1,11 @@
 +--- src/include/memcopy.h.orig
 ++++ src/include/memcopy.h
 +@@ -44,7 +44,7 @@
 + #define CPSIZE_h     sizeof(GR_int64)
 + #endif
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #  include "gcc/memcopy.h"
 + #elif defined(__TURBOC__)
 + #  include "bcc/memcopy.h"
 diff -urN /usr/ports/graphics/grx/files/patch-src__include__memfill.h graphics/grx/files/patch-src__include__memfill.h
 --- /usr/ports/graphics/grx/files/patch-src__include__memfill.h	1970-01-01 09:00:00.000000000 +0900
 +++ graphics/grx/files/patch-src__include__memfill.h	2014-04-18 00:00:00.000000000 +0900
 @@ -0,0 +1,11 @@
 +--- src/include/memfill.h.orig
 ++++ src/include/memfill.h
 +@@ -32,7 +32,7 @@
 + #include "arith.h"
 + #endif
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #  include "gcc/memfill.h"
 + #elif defined(__TURBOC__)
 + #  include "bcc/memfill.h"
 diff -urN /usr/ports/graphics/grx/files/patch-src__include__memmode.h graphics/grx/files/patch-src__include__memmode.h
 --- /usr/ports/graphics/grx/files/patch-src__include__memmode.h	1970-01-01 09:00:00.000000000 +0900
 +++ graphics/grx/files/patch-src__include__memmode.h	2014-04-18 00:00:00.000000000 +0900
 @@ -0,0 +1,11 @@
 +--- src/include/memmode.h.orig
 ++++ src/include/memmode.h
 +@@ -19,7 +19,7 @@
 + #ifndef  __MEMMODE_H_INCLUDED__
 + #define  __MEMMODE_H_INCLUDED__
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #include "gcc/memmode.h"
 + #elif defined(__TURBOC__)
 + #include "bcc/memmode.h"
 diff -urN /usr/ports/graphics/grx/files/patch-src__include__mempeek.h graphics/grx/files/patch-src__include__mempeek.h
 --- /usr/ports/graphics/grx/files/patch-src__include__mempeek.h	1970-01-01 09:00:00.000000000 +0900
 +++ graphics/grx/files/patch-src__include__mempeek.h	2014-04-18 00:00:00.000000000 +0900
 @@ -0,0 +1,11 @@
 +--- src/include/mempeek.h.orig
 ++++ src/include/mempeek.h
 +@@ -29,7 +29,7 @@
 + #include "memmode.h"
 + #endif
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #include "gcc/mempeek.h"
 + #elif defined(__TURBOC__)
 + #include "bcc/mempeek.h"
 diff -urN /usr/ports/graphics/grx/files/patch-src__utils__shiftscl.c graphics/grx/files/patch-src__utils__shiftscl.c
 --- /usr/ports/graphics/grx/files/patch-src__utils__shiftscl.c	1970-01-01 09:00:00.000000000 +0900
 +++ graphics/grx/files/patch-src__utils__shiftscl.c	2014-04-18 00:00:00.000000000 +0900
 @@ -0,0 +1,20 @@
 +--- src/utils/shiftscl.c.orig
 ++++ src/utils/shiftscl.c
 +@@ -34,7 +34,7 @@
 +     for (plane = 0; plane < planes; ++plane) {
 +       GR_int8u far *s = *(src++) + ws;
 +       GR_int8u far *d = *(dst++) + ws;
 +-#     if defined(__GNUC__) && defined(__i386__)
 ++#     if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + 	int _dummy_, w = ws;
 + 	/* sad but true: the x86 bytesex forces this inefficient code :( */
 + 	asm volatile ("\n"
 +@@ -91,7 +91,7 @@
 +     for (plane = 0; plane < planes; ++plane) {
 +       GR_int8u far *s = *(src++);
 +       GR_int8u far *d = *(dst++);
 +-#     if defined(__GNUC__) && defined(__i386__)
 ++#     if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + 	int _dummy_, w = ws;
 + 	asm volatile ("\n"
 + 	  "   movb    (%0),%%ch    \n"
 
 --Multipart=_Fri__18_Apr_2014_02_51_03_+0900_Axtq+HybA7xy0WuY--
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Sun May 18 04:59:13 UTC 2014 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/188139: commit references a PR
Date: Sun, 18 May 2014 04:59:21 +0000 (UTC)

 Author: miwi
 Date: Sun May 18 04:59:13 2014
 New Revision: 354392
 URL: http://svnweb.freebsd.org/changeset/ports/354392
 QAT: https://qat.redports.org/buildarchive/r354392/
 
 Log:
   - Fix build on i386
   - Stage support
   
   PR:		188139
   Submitted by:	Ports Fury
 
 Added:
   head/graphics/grx/files/patch-src__fdrivers__driver16.h   (contents, props changed)
   head/graphics/grx/files/patch-src__include__arith.h   (contents, props changed)
   head/graphics/grx/files/patch-src__include__memcopy.h   (contents, props changed)
   head/graphics/grx/files/patch-src__include__memfill.h   (contents, props changed)
   head/graphics/grx/files/patch-src__include__memmode.h   (contents, props changed)
   head/graphics/grx/files/patch-src__include__mempeek.h   (contents, props changed)
   head/graphics/grx/files/patch-src__utils__shiftscl.c   (contents, props changed)
 Modified:
   head/graphics/grx/Makefile
 
 Modified: head/graphics/grx/Makefile
 ==============================================================================
 --- head/graphics/grx/Makefile	Sun May 18 04:57:08 2014	(r354391)
 +++ head/graphics/grx/Makefile	Sun May 18 04:59:13 2014	(r354392)
 @@ -9,20 +9,13 @@ MASTER_SITES=	http://grx.gnu.de/download
  DISTNAME=	${PORTNAME}${PORTVERSION:S/.//g}
  
  MAINTAINER=	ports@FreeBSD.org
 -COMMENT=	A 2D graphics library
 +COMMENT=	2D graphics library
  
  LICENSE=	LGPL20 MIT
  LICENSE_COMB=	multi
  
 -LIB_DEPENDS=	pthread-stubs:${PORTSDIR}/devel/libpthread-stubs
 -
 -OPTIONS_DEFINE=	BGI BMP JPEG PNG PRINT TIFF ZLIB
 -OPTIONS_DEFAULT=	ZLIB BGI BMP PNG PRINT
 -BGI_DESC=	Enable BGI support
 -BMP_DESC=	Enable BMP support
 -
 -USE_XORG=	x11 xau xcb xdmcp
  USES=		gmake
 +USE_XORG=	x11 xau xcb xdmcp
  HAS_CONFIGURE=	yes
  CONFIGURE_ARGS=	--prefix=${PREFIX} --with-fontpath=${DATADIR}/fonts \
  		--with-x11-base=${LOCALBASE}
 @@ -37,59 +30,29 @@ PLIST_SUB=	VERSION="${PORTVERSION}"
  
  INFO=		grx
  
 -.include <bsd.port.options.mk>
 -
 -.if ${PORT_OPTIONS:MBGI}
 -CONFIGURE_ARGS+=--enable-bgi
 -PLIST_SUB+=	BGI=""
 -.else
 -CONFIGURE_ARGS+=--disable-bgi
 -PLIST_SUB+=	BGI="@comment "
 -.endif
 -
 -.if ${PORT_OPTIONS:MBMP}
 -CONFIGURE_ARGS+=--enable-bmp
 -.else
 -CONFIGURE_ARGS+=--disable-bmp
 -.endif
 -
 -.if ${PORT_OPTIONS:MJPEG}
 -LIB_DEPENDS+=	jpeg:${PORTSDIR}/graphics/jpeg
 -CONFIGURE_ARGS+=--enable-jpeg
 -.else
 -CONFIGURE_ARGS+=--disable-jpeg
 -.endif
 +OPTIONS_DEFINE=		BGI BMP JPEG PNG PRINT TIFF ZLIB
 +OPTIONS_DEFAULT=	BGI BMP PNG PRINT ZLIB
 +OPTIONS_SUB=		yes
 +
 +BGI_DESC=		BGI image format support
 +BGI_CONFIGURE_ENABLE=	bgi
 +BMP_DESC=		BMP image format support
 +BMP_CONFIGURE_ENABLE=	bmp
 +JPEG_LIB_DEPENDS+=	libjpeg.so:${PORTSDIR}/graphics/jpeg
 +JPEG_CONFIGURE_ENABLE=	jpeg
 +PNG_LIB_DEPENDS=	libpng15.so:${PORTSDIR}/graphics/png
 +PNG_CONFIGURE_ENABLE=	png
 +PRINT_CONFIGURE_ENABLE=	print
 +TIFF_LIB_DEPENDS=	libtiff.so:${PORTSDIR}/graphics/tiff
 +TIFF_CONFIGURE_ENABLE=	tiff
 +ZLIB_CONFIGURE_ENABLE=	zlib
  
 -.if ${PORT_OPTIONS:MPNG}
 -LIB_DEPENDS+=	png15:${PORTSDIR}/graphics/png
 -CONFIGURE_ARGS+=--enable-png
 -.else
 -CONFIGURE_ARGS+=--disable-png
 -.endif
 -
 -.if ${PORT_OPTIONS:MPRINT}
 -CONFIGURE_ARGS+=--enable-print
 -PLIST_SUB+=	PRINT=""
 -.else
 -CONFIGURE_ARGS+=--disable-print
 -PLIST_SUB+=	PRINT="@comment "
 -.endif
 -
 -.if ${PORT_OPTIONS:MTIFF}
 -LIB_DEPENDS+=	tiff:${PORTSDIR}/graphics/tiff
 -CONFIGURE_ARGS+=--enable-tiff
 -.else
 -CONFIGURE_ARGS+=--disable-tiff
 -.endif
 +.include <bsd.port.options.mk>
  
 -.if ${PORT_OPTIONS:MZLIB} || !empty(PORT_OPTIONS:MPNG)
 -CONFIGURE_ARGS+=--enable-zlib
 -.else
 -CONFIGURE_ARGS+=--disable-zlib
 +.if ${PORT_OPTIONS:MPNG} && empty(PORT_OPTIONS:MZLIB)
 +IGNORE=		PNG support requires ZLIB support
  .endif
  
 -.include <bsd.port.pre.mk>
 -
  .if ${ARCH} == "amd64"
  CONFIGURE_ARGS+=--enable-x86_64
  .endif
 @@ -101,17 +64,18 @@ BROKEN=		Does not compile on ia64, power
  post-patch:
  	@${GREP} -ERl '<(malloc|alloca)\.h>' ${WRKSRC} | ${XARGS} \
  		${REINPLACE_CMD} -Ee 's|<(malloc\|alloca)\.h>|<stdlib.h>|'
 -	@${REINPLACE_CMD} -Ee \
 -		's|-m32|| ; \
 +	@${REINPLACE_CMD} -e \
 +		's|^\(CC[[:blank:]]*=\).*|\1 ${CC}| ; \
 +		 s|^\(STRIP[[:blank:]]*=\).*|\1 ${TRUE}| ; \
 +		 s|^\(CCOPT[[:blank:]]*=\).*|\1 ${CPPFLAGS} ${CFLAGS}| ; \
 +		 s|^\(LDOPT[[:blank:]]*=\).*|\1 ${LDFLAGS}| ; \
  		 s|-m64|| ; \
 -		 s|^(CC[[:blank:]]*=).*|\1 ${CC}| ; \
 -		 s|^(CCOPT =)|\1 ${CPPFLAGS} ${CFLAGS}| ; \
 -		 s|^(LDOPT =)|\1 ${LDFLAGS}| ; \
 -		 s|lib64|lib|' \
 +		 s|-m32||' \
  		${WRKSRC}/makedefs.grx
 -	@${REINPLACE_CMD} -e \
 -		's|gcc|${CC}| ; \
 -		 s|lib64|lib|' \
 -		${WRKSRC}/src/makefile.[lx]*
  
 -.include <bsd.port.post.mk>
 +post-install:
 +.for i in bin2c fnt2c xmodetest
 +	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${i}
 +.endfor
 +
 +.include <bsd.port.mk>
 
 Added: head/graphics/grx/files/patch-src__fdrivers__driver16.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/graphics/grx/files/patch-src__fdrivers__driver16.h	Sun May 18 04:59:13 2014	(r354392)
 @@ -0,0 +1,36 @@
 +--- src/fdrivers/driver16.h.orig
 ++++ src/fdrivers/driver16.h
 +@@ -46,7 +46,7 @@
 + # define repfill16_and   repfill_w_f_and
 + # define repfill16       repfill_w_f
 + # define SETFARSEL(sel)  setup_far_selector(sel)
 +-# if defined(__GNUC__) && defined(__i386__)
 ++# if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + #   define ASM_386_SEL   I386_GCC_FAR_SELECTOR
 + # endif /* GCC i386 */
 + #else /* defined FAR_ACCESS */
 +@@ -180,7 +180,7 @@
 +     GRX_LEAVE();
 + }
 + 
 +-#if defined(__GNUC__) && defined(__i386__)
 ++#if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + static void drawline(int x,int y,int dx,int dy,GrColor color)
 + {
 +     struct {
 +@@ -196,6 +196,7 @@
 + 
 + #   ifdef __GNUC__
 + #   ifdef __i386__
 ++#   ifndef __clang__
 + #   define ASM_LINE1(OPC) asm volatile(""              \
 + 	"   .align 2,0x90                      \n"     \
 + 	"0: "#OPC"w %6,"ASM_386_SEL"(%0)       \n"     \
 +@@ -236,6 +237,7 @@
 + 	)
 + #   endif
 + #   endif
 ++#   endif
 + 
 +     if(dy < 0) {
 + 	y -= (dy = (-dy));
 
 Added: head/graphics/grx/files/patch-src__include__arith.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/graphics/grx/files/patch-src__include__arith.h	Sun May 18 04:59:13 2014	(r354392)
 @@ -0,0 +1,11 @@
 +--- src/include/arith.h.orig
 ++++ src/include/arith.h
 +@@ -22,7 +22,7 @@
 + #ifndef __ARITH_H_INCLUDED__
 + #define __ARITH_H_INCLUDED__
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #include "gcc/arith.h"
 + #elif defined(__TURBOC__)
 + #include "bcc/arith.h"
 
 Added: head/graphics/grx/files/patch-src__include__memcopy.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/graphics/grx/files/patch-src__include__memcopy.h	Sun May 18 04:59:13 2014	(r354392)
 @@ -0,0 +1,11 @@
 +--- src/include/memcopy.h.orig
 ++++ src/include/memcopy.h
 +@@ -44,7 +44,7 @@
 + #define CPSIZE_h     sizeof(GR_int64)
 + #endif
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #  include "gcc/memcopy.h"
 + #elif defined(__TURBOC__)
 + #  include "bcc/memcopy.h"
 
 Added: head/graphics/grx/files/patch-src__include__memfill.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/graphics/grx/files/patch-src__include__memfill.h	Sun May 18 04:59:13 2014	(r354392)
 @@ -0,0 +1,11 @@
 +--- src/include/memfill.h.orig
 ++++ src/include/memfill.h
 +@@ -32,7 +32,7 @@
 + #include "arith.h"
 + #endif
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #  include "gcc/memfill.h"
 + #elif defined(__TURBOC__)
 + #  include "bcc/memfill.h"
 
 Added: head/graphics/grx/files/patch-src__include__memmode.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/graphics/grx/files/patch-src__include__memmode.h	Sun May 18 04:59:13 2014	(r354392)
 @@ -0,0 +1,11 @@
 +--- src/include/memmode.h.orig
 ++++ src/include/memmode.h
 +@@ -19,7 +19,7 @@
 + #ifndef  __MEMMODE_H_INCLUDED__
 + #define  __MEMMODE_H_INCLUDED__
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #include "gcc/memmode.h"
 + #elif defined(__TURBOC__)
 + #include "bcc/memmode.h"
 
 Added: head/graphics/grx/files/patch-src__include__mempeek.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/graphics/grx/files/patch-src__include__mempeek.h	Sun May 18 04:59:13 2014	(r354392)
 @@ -0,0 +1,11 @@
 +--- src/include/mempeek.h.orig
 ++++ src/include/mempeek.h
 +@@ -29,7 +29,7 @@
 + #include "memmode.h"
 + #endif
 + 
 +-#ifdef __GNUC__
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #include "gcc/mempeek.h"
 + #elif defined(__TURBOC__)
 + #include "bcc/mempeek.h"
 
 Added: head/graphics/grx/files/patch-src__utils__shiftscl.c
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/graphics/grx/files/patch-src__utils__shiftscl.c	Sun May 18 04:59:13 2014	(r354392)
 @@ -0,0 +1,20 @@
 +--- src/utils/shiftscl.c.orig
 ++++ src/utils/shiftscl.c
 +@@ -34,7 +34,7 @@
 +     for (plane = 0; plane < planes; ++plane) {
 +       GR_int8u far *s = *(src++) + ws;
 +       GR_int8u far *d = *(dst++) + ws;
 +-#     if defined(__GNUC__) && defined(__i386__)
 ++#     if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + 	int _dummy_, w = ws;
 + 	/* sad but true: the x86 bytesex forces this inefficient code :( */
 + 	asm volatile ("\n"
 +@@ -91,7 +91,7 @@
 +     for (plane = 0; plane < planes; ++plane) {
 +       GR_int8u far *s = *(src++);
 +       GR_int8u far *d = *(dst++);
 +-#     if defined(__GNUC__) && defined(__i386__)
 ++#     if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
 + 	int _dummy_, w = ws;
 + 	asm volatile ("\n"
 + 	  "   movb    (%0),%%ch    \n"
 _______________________________________________
 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:
