From: Garrett C. <ris...@li...> - 2010-07-04 21:48:34
|
The branch, pu, has been updated via ef399220509ea9889609cb58749dae97d5dbc00b (commit) from 69a66f173dc5e1cee6ff512947a1dbc4521245ce (commit) - Log ----------------------------------------------------------------- commit ef399220509ea9889609cb58749dae97d5dbc00b Author: Garrett Cooper <yan...@gm...> Date: Sun Jul 4 14:44:15 2010 -0700 Push the CFLAGS var into a file for inclusion. This unbreaks compiling C99 keywords, like restrict. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: testcases/open_posix_testsuite/CFLAGS | 3 +++ testcases/open_posix_testsuite/Makefile | 9 +++------ .../scripts/generate-makefiles.sh | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 testcases/open_posix_testsuite/CFLAGS diff --git a/testcases/open_posix_testsuite/CFLAGS b/testcases/open_posix_testsuite/CFLAGS new file mode 100644 index 0000000..27b85d4 --- /dev/null +++ b/testcases/open_posix_testsuite/CFLAGS @@ -0,0 +1,3 @@ +# add -std=c99, -std=gnu99 if compiler supports it (gcc-2.95.3 does not). +# Add appropriate POSIX support as well (needs fixing). +`$(CC) -std=c99 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo "-std=c99"` `$(CC) -std=gnu99 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo "-std=gnu99"` -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 diff --git a/testcases/open_posix_testsuite/Makefile b/testcases/open_posix_testsuite/Makefile index 24e3d9b..8c30a98 100644 --- a/testcases/open_posix_testsuite/Makefile +++ b/testcases/open_posix_testsuite/Makefile @@ -26,13 +26,10 @@ LOGFILE?= logfile # Subdirectories to traverse down. SUBDIRS= conformance functional stress -# add -std=c99, -std=gnu99 if compiler supports it (gcc-2.95.3 does not). -CFLAGS+= `$(CC) -std=c99 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo "-std=c99"` -CFLAGS+= `$(CC) -std=gnu99 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo "-std=gnu99"` -CFLAGS+= -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 - # Force to -j1 so the output in the logfile won't be wonky. -MAKE+= -j1 LOGFILE=`if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ +MAKE+= -j1 "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" +MAKE+= "LDLIBS=$(LDLIBS)" +MAKE+= LOGFILE=`if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ #LDFLAGS+= #LDLIBS+= -lpthread -lrt -lm diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index b194044..8f9cc59 100755 --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -87,6 +87,7 @@ srcdir= \$(top_srcdir)/\$(subdir) EXEC_PREFIX= $EXEC_PREFIX INSTALL_DIR= \$(DESTDIR)/\$(EXEC_PREFIX)/\$(subdir) +LOGFILE?= logfile # Build variables CFLAGS+= -I\$(top_srcdir)/include @@ -96,6 +97,11 @@ CFLAGS+= -I\$(srcdir) EOF + # Include top-level definitions + cat >> "$makefile.1" <<EOF +CFLAGS+= `grep -v '^#' 2>/dev/null CFLAGS` +EOF + for var in CFLAGS LDFLAGS LDLIBS; do if [ -f "$prereq_cache_dir/$var" ]; then hooks/post-receive -- ltp |