Bug 101120 - [patch] bsd.port.mk: Tell CC and CXX to ports without configure
Summary: [patch] bsd.port.mk: Tell CC and CXX to ports without configure
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-31 20:00 UTC by Dominic Fandrey
Modified: 2008-07-24 23:30 UTC (History)
0 users

See Also:


Attachments
file.diff (469 bytes, patch)
2006-07-31 20:00 UTC, Dominic Fandrey
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Fandrey 2006-07-31 20:00:33 UTC
If CC is defined in make.conf inside a block such as this:

.if ${.CURDIR:M/usr/ports/*}
CC= distcc cc
CXX= distcc c++
.endif

And WRKDIRPREFIX is set i.e. like this:

WRKDIRPREFIX=/usr/obj

Maybe because /usr/ports is a read only NFS mount (like on my system),
Ports that do not have a configure target will not receive CC and CXX,
because it's not part of MAKE_ENV and make will fall back to the default (CC=cc),
because the if case in make.conf is not matched.

Examples for ports that are affected by this are devel/qmake and graphics/png .

To fix this I created this patch that adds CC and CXX to the MAKE_ENV
if neither HAS_CONFIGURE nor PERL_CONFIGURE are defined.

How-To-Repeat: To repeat the problem set WRKDIRPREFIX somewhere outside of PORTSDIR
and enclose the settings for ports in make.conf in a block
as described in the full description.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-07-31 20:00:44 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.port.mk is port manager territory
Comment 2 Kris Kennaway 2006-09-20 05:30:00 UTC
On Mon, Jul 31, 2006 at 06:55:16PM +0000, Dominic Fandrey wrote:

> To fix this I created this patch that adds CC and CXX to the MAKE_ENV
> if neither HAS_CONFIGURE nor PERL_CONFIGURE are defined.

You should also pass in the other variables set in the *_CONFIGURE case.

Kris
Comment 3 Dominic Fandrey 2006-09-20 09:58:47 UTC
This is my second attempt, apparently gnats regards my patches as spam.
Anyway, here is the patch (again). I hope I did not forget any variables.
Thank you for taking interest in this.

--- Mk/bsd.port.mk.orig	Wed Sep 20 06:04:05 2006
+++ Mk/bsd.port.mk	Wed Sep 20 10:01:11 2006
@@ -2079,6 +2079,13 @@
 RUN_DEPENDS+=	gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
 .endif
 
+# Ensure that ports without a configure step know about CC and CXX.
+.if !defined(HAS_CONFIGURE) && !defined(PERL_CONFIGURE)
+MAKE_ENV+=	CC="${CC}" CXX="${CXX}" \
+		CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
+		${CONFIGURE_ENV}
+.endif
+
 # Macro for doing in-place file editing using regexps
 REINPLACE_ARGS?=	-i.bak
 REINPLACE_CMD?=	${SED} ${REINPLACE_ARGS}
Comment 4 Gabor Kovesdan freebsd_committer freebsd_triage 2007-06-18 13:12:03 UTC
Short response to note, that I'm addressing this issue in the SoC 2007 
program.

-- 
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org
Comment 5 Dominic Fandrey 2007-06-18 17:04:14 UTC
Gabor Kovesdan wrote:
> Short response to note, that I'm addressing this issue in the SoC 2007
> program.
> 

Hey, this is still open... I thought it had died long ago, i.e. I had given up
hope that this would be addressed..

Thanks for the notification.
Comment 6 kamikaze 2008-03-03 17:45:38 UTC
The issue still partly exists and my patch still completely fixes it.

Without my patch:
# make                              /usr/ports/devel/qmake
...
===>  Building for qmake-3.3.8_1
"/usr/share/mk/bsd.compat.mk", line 35: warning: NOMAN is deprecated in favour 
of NO_MAN
Warning: Object directory not changed from original 
/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake
c++ -O2 -fno-strict-aliasing -pipe -march=nocona 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/mkspecs/freebsd-g++ 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/src/tools 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/src/kernel 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/src/codecs 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/. 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/unix 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/win32 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/mac 
-I. -I"/usr/ports/devel/qmake/files" -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES 
-DQT_NO_COMPONENT  -DQT_NO_STL -DQT_NO_COMPRESS 
-DQT_INSTALL_DATA="\"/usr/local/share/qt\"" -c project.cpp
...

With the patch:

# make                              /usr/ports/devel/qmake
...
===>  Building for qmake-3.3.8_1
"/usr/share/mk/bsd.compat.mk", line 35: warning: NOMAN is deprecated in favour 
of NO_MAN
Warning: Object directory not changed from original 
/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake
/usr/local/bin/ccache c++ -O2 -fno-strict-aliasing -pipe -march=nocona 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/mkspecs/freebsd-g++ 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/src/tools 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/src/kernel 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/src/codecs 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/. 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/unix 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/win32 
-I/usr/obj/mobileKamikaze.norad/usr/ports/devel/qmake/work/qt-x11-free-3.3.8/qmake/generators/mac 
-I. -I"/usr/ports/devel/qmake/files" -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES 
-DQT_NO_COMPONENT  -DQT_NO_STL -DQT_NO_COMPRESS 
-DQT_INSTALL_DATA="\"/usr/local/share/qt\"" -c project.cpp
...

As you can see the CFLAGS are the same, but CC is ignored by the port, without 
the patch.
Comment 7 Pav Lucistnik freebsd_committer freebsd_triage 2008-07-24 23:28:48 UTC
State Changed
From-To: open->closed

Modified version of this patch was committed
Comment 8 dfilter service freebsd_committer freebsd_triage 2008-07-24 23:29:47 UTC
pav         2008-07-24 22:29:33 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.gcc.mk bsd.port.mk 
    games/formido        Makefile 
    graphics/gdal/files  patch-swig-python-GNUmakefile 
    x11-toolkits/xmhtml  Makefile 
    x11-wm/sapphire      Makefile 
  Log:
  - Add CC and CXX to MAKE_ENV for all ports
  
  PR:             ports/86106, ports/101120 (based on)
  
  Revision  Changes    Path
  1.18      +1 -3      ports/Mk/bsd.gcc.mk
  1.600     +4 -3      ports/Mk/bsd.port.mk
  1.8       +2 -1      ports/games/formido/Makefile
  1.2       +1 -1      ports/graphics/gdal/files/patch-swig-python-GNUmakefile
  1.32      +1 -1      ports/x11-toolkits/xmhtml/Makefile
  1.21      +1 -1      ports/x11-wm/sapphire/Makefile
_______________________________________________
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"