1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

- Fix build on i386

- Stage support

PR:		188139
Submitted by:	Ports Fury
This commit is contained in:
Martin Wilke 2014-05-18 04:59:13 +00:00
parent 82047d9250
commit 865d170328
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=354392
8 changed files with 145 additions and 70 deletions

View File

@ -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
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
.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 "
.if ${PORT_OPTIONS:MPNG} && empty(PORT_OPTIONS:MZLIB)
IGNORE= PNG support requires ZLIB support
.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
.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
.if ${PORT_OPTIONS:MZLIB} || !empty(PORT_OPTIONS:MPNG)
CONFIGURE_ARGS+=--enable-zlib
.else
CONFIGURE_ARGS+=--disable-zlib
.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, powerpc, or sparc64
post-patch:
@${GREP} -ERl '<(malloc|alloca)\.h>' ${WRKSRC} | ${XARGS} \
${REINPLACE_CMD} -Ee 's|<(malloc\|alloca)\.h>|<stdlib.h>|'
@${REINPLACE_CMD} -Ee \
's|-m32|| ; \
s|-m64|| ; \
s|^(CC[[:blank:]]*=).*|\1 ${CC}| ; \
s|^(CCOPT =)|\1 ${CPPFLAGS} ${CFLAGS}| ; \
s|^(LDOPT =)|\1 ${LDFLAGS}| ; \
s|lib64|lib|' \
${WRKSRC}/makedefs.grx
@${REINPLACE_CMD} -e \
's|gcc|${CC}| ; \
s|lib64|lib|' \
${WRKSRC}/src/makefile.[lx]*
's|^\(CC[[:blank:]]*=\).*|\1 ${CC}| ; \
s|^\(STRIP[[:blank:]]*=\).*|\1 ${TRUE}| ; \
s|^\(CCOPT[[:blank:]]*=\).*|\1 ${CPPFLAGS} ${CFLAGS}| ; \
s|^\(LDOPT[[:blank:]]*=\).*|\1 ${LDFLAGS}| ; \
s|-m64|| ; \
s|-m32||' \
${WRKSRC}/makedefs.grx
.include <bsd.port.post.mk>
post-install:
.for i in bin2c fnt2c xmodetest
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${i}
.endfor
.include <bsd.port.mk>

View File

@ -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));

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"