Skip to content

Honor external CCFLAGS and LDFLAGS

username-removed-546878 requested to merge akien/open-adventure:flags into master

This allows e.g. (using Mageia's default CC %{optflags} and %{ldflags}):

$ export CCFLAGS="-O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4"
$ export LDFLAGS=" -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags"
$ make
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99 -o compile compile.c
compile.c: Dans la fonction ‘MAPLIN’:
compile.c:190:5: attention : ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
     fgets(INLINE + 1, sizeof(INLINE) - 1, OPENED);
     ^
./compile
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -c database.c
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -c main.c
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -c init.c
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -c actions1.c
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -c actions2.c
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -c score.c
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -c misc.c
cc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c99  -o advent main.o init.o actions1.o actions2.o score.o misc.o database.o  -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -lrt

Merge request reports

Loading