how to set CFLAGS variable for compiling Xorg

Joel Feiner jafeiner at gmail.com
Tue Nov 4 07:40:19 PST 2008


You can do this when you run ./configure:

./configure --prefix=/usr CFLAGS="-g3 -O0"

You probably want to run 'make distclean' first.

ludo wrote:
> Hi,
> 
> I'd like to compile Xorg with debugging info (-g3 -O0 flags)
> I have tried to use
>     make CFLAGS=<my flags>
> but this method corrupts the entire command line
> 
> for exemple in libXfont
> 
> With the standard 'make', it works well
> $ make
> [...]
> make[3]: Entering directory 
> `/d/sources/xorg-git-auto/libXfont.dummy/src/fontfile'
> [...]
>   gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include/X11/fonts 
> -I../../include 
> -DFONT_ENCODINGS_DIRECTORY=\"/d/sources/xorg-git-auto/root/lib/X11/fonts/encodings/encodings.dir\" 
> -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
> -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -g -O2 
> -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT 
> -I/d/sources/xorg-git-auto/root/include -MT bitsource.lo -MD -MP -MF 
> .deps/bitsource.Tpo -c bitsource.c  -DDLL_EXPORT -DPIC -o .libs/bitsource.o
> 
> But If I try to set CFLAGS, make failed
> $ make CFLAGS="-g3 -O0"
> [...]
> make[3]: Entering directory 
> `/d/sources/xorg-git-auto/libXfont.dummy/src/fontfile'
> [...]
>   gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include/X11/fonts 
> -I../../include 
> -DFONT_ENCODINGS_DIRECTORY=\"/d/sources/xorg-git-auto/root/lib/X11/fonts/encodings/encodings.dir\" 
> -g3 -O0 -MT bitsource.lo -MD -MP -MF .deps/bitsource.Tpo -c bitsource.c  
> -DDLL_EXPORT -DPIC -o .libs/bitsource.o
> In file included from bitsource.c:37:
> ../../include/X11/fonts/fntfilst.h:38:21: X11/Xos.h: No such file or 
> directory
> 
> 
> When I set CFLAGS, the command line is modified :
> "-g -O2" is replaced by "-g3 -O0" (that's perfect)
> but
> "-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
> -Wmissing-declarations -Wnested-externs -fno-strict-aliasing" is removed
> "-D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT 
> -I/d/sources/xorg-git-auto/root/include" is also removed
> 
> What is the correct way for passing additionnal parameters to gcc from 
> make ?
> 
> thanks
> 
> 
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
> 



More information about the xorg mailing list