Bug 99495 - graphics/dri-devel port does not build with custom CFLAGS
Summary: graphics/dri-devel port does not build with custom CFLAGS
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: Eric Anholt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-26 18:10 UTC by Artem Naluzhny
Modified: 2006-06-29 15:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Naluzhny 2006-06-26 18:10:24 UTC
Can not build graphics/dri-devel port with CFLAGS set.

$ cd /usr/ports/graphics/dri-devel
$ make CFLAGS=-mtune=pentium4 all
..
===>  Patching for dri-6.5.20060624,1
/usr/bin/sed -i.bak  -e 's|/usr/X11R6|/usr/X11R6|g'  -e 's|/usr/local|/usr/local|g'  -e 's|gcc|cc|g'  -e 's|g++|c++|g'  -e 's|CFLAGS = |CFLAGS = -mtune=pentium4|g'  -e 's|OPT_FLAGS = .*|OPT_FLAGS = -mtune=pentium4|g'  -e 's|-pthread|-pthread|g'  /usr/ports/graphics/dri-devel/work/Mesa/configs/freebsd-dri
..
gmake[3]: Entering directory `/usr/ports/graphics/dri-devel/work/Mesa/src/glx/x11'
cc -c -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi -I../../../src/mesa/drivers/dri/common `pkg-config --cflags libdrm` -I/usr/X11R6/include -mtune=pentium4-Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -I/usr/X11R6/include -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER -DDEFAULT_DRIVER_DIR=\"/usr/X11R6/lib/modules/dri\" glcontextmodes.c -o glcontextmodes.o
glcontextmodes.c:1: error: bad value (pentium4-Wmissing-prototypes) for -mtune= switch
gmake[3]: *** [glcontextmodes.o] Error 1
gmake[3]: Leaving directory `/usr/ports/graphics/dri-devel/work/Mesa/src/glx/x11'
gmake[2]: *** [subdirs] Error 1
gmake[2]: Leaving directory `/usr/ports/graphics/dri-devel/work/Mesa/src'
gmake[1]: *** [default] Error 1
gmake[1]: Leaving directory `/usr/ports/graphics/dri-devel/work/Mesa'
gmake: *** [freebsd-dri-x86] Error 2
*** Error code 2

Stop in /usr/ports/graphics/dri-devel.

-------------------
Look at /usr/ports/graphics/dri-devel/work/Mesa/configs/freebsd-dri:

"CFLAGS = -mtune=pentium4-Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math \
        $(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES)"

Fix: 

--- Makefile.orig
+++ Makefile
@@ -55,7 +55,7 @@
                -e 's|/usr/local|${LOCALBASE}|g' \
                -e 's|gcc|${CC}|g' \
                -e 's|g++|${CXX}|g' \
-               -e 's|CFLAGS = |CFLAGS = ${CFLAGS}|g' \
+               -e 's|CFLAGS = |CFLAGS = ${CFLAGS} |g' \
                -e 's|OPT_FLAGS = .*|OPT_FLAGS = ${CFLAGS}|g' \
                -e 's|-pthread|${PTHREAD_LIBS}|g' \
                ${WRKSRC}/configs/freebsd-dri
How-To-Repeat: cd /usr/ports/graphics/dri-devel
make CFLAGS=-mtune=pentium4 all
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-06-26 18:39:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->anholt

Over to maintainer
Comment 2 Eric Anholt freebsd_committer freebsd_triage 2006-06-29 15:18:03 UTC
State Changed
From-To: open->closed

Committed.  Thanks!