From nobody@FreeBSD.org  Sat Nov 21 01:58:53 2009
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 2B0E6106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Nov 2009 01:58:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 0016C8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Nov 2009 01:58:52 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nAL1wpnF002483
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Nov 2009 01:58:51 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nAL1wpGK002482;
	Sat, 21 Nov 2009 01:58:51 GMT
	(envelope-from nobody)
Message-Id: <200911210158.nAL1wpGK002482@www.freebsd.org>
Date: Sat, 21 Nov 2009 01:58:51 GMT
From: Bojan Petrovic <bpetrovi@f.bg.ac.rs>
To: freebsd-gnats-submit@FreeBSD.org
Subject: emulators/hatari does not build if emulators/rtc is installed
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         140731
>Category:       ports
>Synopsis:       emulators/hatari does not build if emulators/rtc is installed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    stefan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 21 02:00:05 UTC 2009
>Closed-Date:    Tue May 18 21:47:02 UTC 2010
>Last-Modified:  Tue May 18 21:50:01 UTC 2010
>Originator:     Bojan Petrovic
>Release:        7.2-STABLE
>Organization:
>Environment:
FreeBSD localhost 7.2-STABLE FreeBSD 7.2-STABLE #0: Sat Sep 19 12:21:53 CEST 2009     root@localhost:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
If emulators/rtc port is installed, the emulators/hatari port will 
not build.

The build fails with:

cc -O1 -pipe -Wall -D_THREAD_SAFE -I/usr/local/include   -I/usr/local/include/libpng  -I.. -I./includes -Iuae-cpu -I./falcon -DCONFDIR=\"/usr/local/etc\" -I/usr/local/include/SDL -I/usr/local/include -D_GNU_SOURCE=1 -D_REENTRANT -DENABLE_DSP_EMU=1  -c -o ioMemTabST.o ioMemTabST.c
ioMemTabST.c:160: error: 'Rtc_SecondsUnits_ReadByte' undeclared here (not in a function)
ioMemTabST.c:162: error: 'Rtc_SecondsTens_ReadByte' undeclared here (not in a function)
ioMemTabST.c:164: error: 'Rtc_MinutesUnits_ReadByte' undeclared here (not in a function)
[similar lines removed]

Diagnosis:

1. The emulators/rtc port installs /usr/local/include/rtc.h

2. There are several .c files in hatari's src directory which
include src/includes/rtc.h by `#include "rtc.h"'

3. After the configure step, the @X_CFLAGS@ in Makefile.cnf.in is
replaced with `-D_THREAD_SAFE -I/usr/local/include' (the output of
`pkg-config --cflags x11'). This makes /usr/local/include the
first directory to be searched for include files, shadowing the
hatari's src/includes directory. Beacuse of this, the wrong rtc.h is 
included.
>How-To-Repeat:
Install emulators/rtc and build emulators/hatari.
>Fix:
1) Replace `#include "str.h"' with `#include "./includes/str.h"' in:

src/ioMemTabFalcon.c
src/ioMemTabST.c
src/ioMemTabSTE.c
src/ioMemTabTT.c
src/rtc.c

1a) Add the following line in the post-patch rule:

@${REINPLACE_CMD} -e \
's|^#include "rtc.h"|#include "./includes/rtc.h"|' ${WRKSRC}/src/*.c

Or

1b) Add patch for exactly those files to port

Or

2) Set the X_CFLAGS environment variable to
the output of `pkg-config --cflags-only-other x11' :

CONFIGURE_ENV=X_CFLAGS=`pkg-config --cflags-only-other x11`

This removes `-I/usr/local/include' from CFLAGS, but
this directory is included as a SDL requirement.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Sat Nov 21 14:51:15 UTC 2009 
State-Changed-Why:  
could you please provide a patch? 

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

From: Bojan Petrovic <bpetrovi@f.bg.ac.rs>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/140731: emulators/hatari does not build if emulators/rtc is installed
Date: Sun, 22 Nov 2009 02:50:34 +0100

 This is a multi-part message in MIME format.
 
 --=_4b0898ea.yD6jlRUKJY4VKKIOto2j2eKKtCQoGbezheR9BkSGBM1yPjob
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Attached bellow is the port patch.
 
 The two created patch files will only change the order of compiler's include
 options.
 
 --=_4b0898ea.yD6jlRUKJY4VKKIOto2j2eKKtCQoGbezheR9BkSGBM1yPjob
 Content-Type: text/plain;
  charset=us-ascii
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="hatari-port-patch.diff"
 
 diff -r 8aaf4cf9ba5d files/patch-Makefile.cnf.in
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 +++ files/patch-Makefile.cnf.in	Sun Nov 22 02:29:54 2009 +0100
 @@ -0,0 +1,22 @@
 +# This patch prevents shadowing of hatari's header
 +# files by files in directories mentioned in X_CFLAGS.
 +--- Makefile.cnf.in	Sun Nov 22 01:43:31 2009 +0100
 ++++ Makefile.cnf.in	Sun Nov 22 01:58:24 2009 +0100
 +@@ -5,7 +5,7 @@
 + CC = @CC@
 + 
 + # Set flags passed to the compiler (e.g. optimization flags)
 +-CFLAGS = @CFLAGS@ @X_CFLAGS@
 ++CFLAGS = @CFLAGS@
 + 
 + # Set flags passed to the preprocessor (e.g. -I<include dir>)
 + CPPFLAGS = @CPPFLAGS@
 +@@ -30,7 +30,7 @@
 + 
 + 
 + # SDL-Library configuration (compiler flags and linker options)
 +-SDL_CFLAGS = @SDL_CFLAGS@
 ++SDL_CFLAGS = @X_CFLAGS@ @SDL_CFLAGS@
 + SDL_LIBS = @SDL_LIBS@
 + 
 + 
 diff -r 8aaf4cf9ba5d files/patch-tools_hmsa_Makefile
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 +++ files/patch-tools_hmsa_Makefile	Sun Nov 22 02:29:54 2009 +0100
 @@ -0,0 +1,13 @@
 +# This patch prevents shadowing of hatari's header
 +# files by files in directories mentioned in X_CFLAGS.
 +--- tools/hmsa/Makefile	Sun Nov 22 01:43:31 2009 +0100
 ++++ tools/hmsa/Makefile	Sun Nov 22 01:59:13 2009 +0100
 +@@ -8,7 +8,7 @@
 + OBJS = $(HMSA_OBJS) $(HATARI_OBJS:%.o=../../src/%.o)
 + 
 + # Additional include directories:
 +-CPPFLAGS += $(SDL_CFLAGS) -I../.. -I../../src/includes -I../../src/uae-cpu
 ++CPPFLAGS += -I../.. -I../../src/includes -I../../src/uae-cpu $(SDL_CFLAGS)
 + 
 + all: hmsa
 + 
 
 --=_4b0898ea.yD6jlRUKJY4VKKIOto2j2eKKtCQoGbezheR9BkSGBM1yPjob--

From: pgollucci@FreeBSD.org
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/140731 emulators/hatari does not build if emulators/rtc is installed
Date: Mon, 18 Jan 2010 02:26:49 -0500

 ping....
 
Responsible-Changed-From-To: freebsd-ports-bugs->stefan 
Responsible-Changed-By: stefan 
Responsible-Changed-When: Tue May 18 21:30:55 UTC 2010 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140731 
State-Changed-From-To: feedback->closed 
State-Changed-By: stefan 
State-Changed-When: Tue May 18 21:46:46 UTC 2010 
State-Changed-Why:  
Patch committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/140731: commit references a PR
Date: Tue, 18 May 2010 21:44:51 +0000 (UTC)

 stefan      2010-05-18 21:44:36 UTC
 
   FreeBSD ports repository
 
   Added files:
     emulators/hatari/files patch-Makefile.cnf.in 
                            patch-tools_hmsa_Makefile 
   Log:
   Change order of includes so the port still builds fine if emulators/rtc is
   installed.
   
   PR:             ports/140731
   Submitted by:   Bojan Petrovic <bpetrovi@f.bg.ac.rs>
   
   Revision  Changes    Path
   1.1       +22 -0     ports/emulators/hatari/files/patch-Makefile.cnf.in (new)
   1.1       +13 -0     ports/emulators/hatari/files/patch-tools_hmsa_Makefile (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
