Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jan 2014 18:10:00 GMT
From:      KATO Tsuguru <tkato432@yahoo.com>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/185508: emulators/generator: Fix build with clang
Message-ID:  <201401201810.s0KIA0ia093793@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/185508; it has been noted by GNATS.

From: KATO Tsuguru <tkato432@yahoo.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/185508: emulators/generator: Fix build with clang
Date: Tue, 21 Jan 2014 02:58:04 +0900

 This is a multi-part message in MIME format.
 
 --Multipart=_Tue__21_Jan_2014_02_58_04_+0900_/zSeaSnqH_CRhONW
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 
 Remake of the patch against current tree.
 
 --Multipart=_Tue__21_Jan_2014_02_58_04_+0900_/zSeaSnqH_CRhONW
 Content-Type: text/x-diff;
  name="emulators_generator.diff"
 Content-Disposition: attachment;
  filename="emulators_generator.diff"
 Content-Transfer-Encoding: 7bit
 
 diff -urN /usr/ports/emulators/generator/Makefile emulators/generator/Makefile
 --- /usr/ports/emulators/generator/Makefile	2013-11-06 22:06:22.000000000 +0900
 +++ emulators/generator/Makefile	2014-01-21 00:00:00.000000000 +0900
 @@ -10,64 +10,50 @@
  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	SEGA Genesis emulator
  
 -LIB_DEPENDS=	jpeg.11:${PORTSDIR}/graphics/jpeg
 +LICENSE=	GPLv2
  
 +LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg
 +
 +USES=		gmake
  USE_GNOME=	gtk12
  USE_SDL=	sdl
 -USE_GMAKE=	yes
 -
  GNU_CONFIGURE=	yes
 -CPPFLAGS+=	-I${LOCALBASE}/include
 -LDFLAGS+=	-L${LOCALBASE}/lib
 -CONFIGURE_ARGS+=--with-gtk
 -
 +CONFIGURE_ARGS=	--with-gtk
  MAKE_ARGS=	ACLOCAL="${TRUE}" AUTOCONF="${TRUE}" AUTOMAKE="${TRUE}" \
  		AUTOHEADER="${TRUE}"
  MAKE_JOBS_UNSAFE=	yes
  
 -OPTIONS_DEFINE=	OPTIMIZED_CFLAGS RAZE SDL
 -RAZE_DESC=	Use RAZE z80 emulation (only for i386)
 -SDL_DESC=	Use SDL for audio
 +CPPFLAGS+=	-I${LOCALBASE}/include
 +LDFLAGS+=	-L${LOCALBASE}/lib
  
  PLIST_FILES=	bin/${PORTNAME}-gtk
  
 -NO_STAGE=	yes
 -.include <bsd.port.pre.mk>
 +OPTIONS_DEFINE=		OPTIMIZED_CFLAGS SDL
 +OPTIONS_DEFINE_i386=	RAZE
  
 -.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
 -CONFIGURE_ARGS+=--with-gcc=3
 -.else
 -CONFIGURE_ARGS+=--without-gcc
 -.endif
 +OPTIMIZED_CFLAGS_CONFIGURE_ON=	--with-gcc=3
 +OPTIMIZED_CFLAGS_CONFIGURE_OFF=	--without-gcc
 +RAZE_DESC=		Use RAZE z80 emulation
 +RAZE_BUILD_DEPENDS=	nasm:${PORTSDIR}/devel/nasm
 +RAZE_CONFIGURE_ON=	--with-raze
 +SDL_DESC=		Use SDL for audio
 +SDL_CONFIGURE_ON=	--with-sdl-audio
 +
 +.include <bsd.port.options.mk>
  
 -.if ${PORT_OPTIONS:MRAZE} && ${ARCH} == "i386"
 -BUILD_DEPENDS+=	nasm:${PORTSDIR}/devel/nasm
 -CONFIGURE_ARGS+=--with-raze
 -.else
 +.if empty(PORT_OPTIONS:MRAZE)
  CONFIGURE_ARGS+=--with-cmz80
  .endif
  
 -.if ${PORT_OPTIONS:MSDL}
 -CONFIGURE_ARGS+=--with-sdl-audio
 -.endif
 +.include <bsd.port.pre.mk>
  
  post-patch:
  .if ${ARCH} != "amd64" && ${ARCH} != "i386"
  # These architectures do not support "-minline-all-stringops"
 -	@${REINPLACE_CMD} -e 's|-minline-all-stringops||g' \
 -		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 -.   if ${ARCH} == "alpha"
 -# "-ffast-math" does not work on alpha
 -	@${REINPLACE_CMD} -e 's|-ffast-math||g' \
 -		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 -.   endif
 +	@${REINPLACE_CMD} -e \
 +		's|-minline-all-stringops||g' ${WRKSRC}/configure
  .endif
 -	@${REINPLACE_CMD} -e '/%define %1 @UNDERSCORE@%1 /d' \
 -		${WRKSRC}/raze/raze.asm.in
 -
 -post-install:
 -	@${ECHO_CMD}
 -	@${CAT} ${PKGMESSAGE}
 -	@${ECHO_CMD}
 +	@${REINPLACE_CMD} -e \
 +		'/%define %1 @UNDERSCORE@%1 /d' ${WRKSRC}/raze/raze.asm.in
  
  .include <bsd.port.post.mk>
 diff -urN /usr/ports/emulators/generator/files/patch-hdr__registers.h emulators/generator/files/patch-hdr__registers.h
 --- /usr/ports/emulators/generator/files/patch-hdr__registers.h	1970-01-01 09:00:00.000000000 +0900
 +++ emulators/generator/files/patch-hdr__registers.h	2014-01-21 00:00:00.000000000 +0900
 @@ -0,0 +1,24 @@
 +--- hdr/registers.h.orig
 ++++ hdr/registers.h
 +@@ -3,6 +3,7 @@
 +    call a C function, then when that C function returns these registers are
 +    still what they were before we made the call. */
 + 
 ++#if defined(__GNUC__) && !defined(__clang__)
 + #ifdef PROCESSOR_ARM
 +      register uint32 reg68k_pc asm ("r7");
 +      register uint32 *reg68k_regs asm ("r8");
 +@@ -17,10 +18,11 @@
 +          register uint32 reg68k_pc asm ("%ebx");
 +          register uint32 *reg68k_regs asm ("%edi");
 +          register t_sr reg68k_sr asm ("%esi");
 ++#    endif
 ++#  endif
 ++#endif
 + #    else
 +          extern uint32 reg68k_pc;
 +          extern uint32 *reg68k_regs;
 +          extern t_sr reg68k_sr;
 +-#    endif
 +-#  endif
 + #endif
 diff -urN /usr/ports/emulators/generator/files/patch-main__reg68k.c emulators/generator/files/patch-main__reg68k.c
 --- /usr/ports/emulators/generator/files/patch-main__reg68k.c	1970-01-01 09:00:00.000000000 +0900
 +++ emulators/generator/files/patch-main__reg68k.c	2014-01-21 00:00:00.000000000 +0900
 @@ -0,0 +1,13 @@
 +--- main/reg68k.c.orig
 ++++ main/reg68k.c
 +@@ -20,8 +20,8 @@
 + 
 + /*** global variables ***/
 + 
 +-#if (!(defined(PROCESSOR_ARM) || defined(PROCESSOR_SPARC) \
 +-       || defined(PROCESSOR_INTEL)))
 ++#if ((!(defined(PROCESSOR_ARM) || defined(PROCESSOR_SPARC) \
 ++       || defined(PROCESSOR_INTEL))) || defined(__clang__))
 + uint32 reg68k_pc;
 + uint32 *reg68k_regs;
 + t_sr reg68k_sr;
 
 --Multipart=_Tue__21_Jan_2014_02_58_04_+0900_/zSeaSnqH_CRhONW--



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