boludoz / lz4

Automatically exported from code.google.com/p/lz4
Other
0 stars 0 forks source link

Unable to build when CFLAGS variable in set #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. have a clean environment, without lz4.h installed in /usr/include
2. export CFLAGS=''
3. make

$ make
cc  -I. -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"r114\" -c lz4.c lz4hc.c
ar rcs liblz4.a lz4.o lz4hc.o
cc  -I. -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"r114\" -shared lz4.c 
lz4hc.c -fPIC -Wl,-soname=liblz4.so.1 -o liblz4.so.1.0.0
make[1]: Entering directory '/home/seblu/scm/open/lz4/programs'
cc       -I. -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION=\"r114\" 
-DDISABLE_LZ4C_LEGACY_OPTIONS ../lz4.c ../lz4hc.c bench.c xxhash.c lz4io.c 
lz4cli.c -o lz4
bench.c:61:17: fatal error: lz4.h: No such file or directory
 #include "lz4.h"
                 ^
compilation terminated.
lz4io.c:60:17: fatal error: lz4.h: No such file or directory
 #include "lz4.h"
                 ^
compilation terminated.
lz4cli.c:62:17: fatal error: lz4.h: No such file or directory
 #include "lz4.h"
                 ^
compilation terminated.
Makefile:57: recipe for target 'lz4' failed
make[1]: *** [lz4] Error 1
make[1]: Leaving directory '/home/seblu/scm/open/lz4/programs'
Makefile:70: recipe for target 'default' failed
make: *** [default] Error 2

This come from you call to "make -e", which override your defined CFLAGS value 
(with -I..) in the sub makefile.

Original issue reported on code.google.com by sebastien.luttringer on 13 Mar 2014 at 12:41

GoogleCodeExporter commented 9 years ago
OK, thanks for report.
I never tested with an exported null CFLAG, and wasn't aware that it could 
happen.
Would you mind describing in which case this is a valid situation ?

Original comment by yann.col...@gmail.com on 13 Mar 2014 at 9:28

GoogleCodeExporter commented 9 years ago
Issue is when the CFLAGS var is set (empty or not). The archlinux build system 
define this variable with something like "-march=x86-64 -mtune=generic -O2 
-pipe -fstack-protector --param=ssp-buffer-size=4".

Original comment by sebastien.luttringer on 13 Mar 2014 at 9:55

GoogleCodeExporter commented 9 years ago
OK, clear,
maybe we simply need to store -I.. into another variable,
such as, for example, LDFLAGS ?

Original comment by yann.col...@gmail.com on 13 Mar 2014 at 10:00

GoogleCodeExporter commented 9 years ago

Original comment by yann.col...@gmail.com on 13 Mar 2014 at 10:01

GoogleCodeExporter commented 9 years ago
LDFLAGS should follow the same inherit logic as you use for CFLAGS. This 
variable is for linker.

I would suggest to put -I.. and -I. directly inside the makefile line, not in a 
variable. This is not something you want to be overridden.

Original comment by sebastien.luttringer on 13 Mar 2014 at 10:07

GoogleCodeExporter commented 9 years ago
OK, thanks. I'll use your suggestion.

Original comment by yann.col...@gmail.com on 13 Mar 2014 at 10:08

GoogleCodeExporter commented 9 years ago
The following release candidate attempts to correct the export CFLAGS issue.
Tested using your example configuration steps.

Original comment by yann.col...@gmail.com on 13 Mar 2014 at 10:35

Attachments:

GoogleCodeExporter commented 9 years ago
No more build error with this version, but symlinks are not correct.

Original comment by sebastien.luttringer on 18 Mar 2014 at 11:01

GoogleCodeExporter commented 9 years ago
Fixed into r115

Original comment by yann.col...@gmail.com on 23 Mar 2014 at 11:17