From: Garrett C. <ris...@li...> - 2010-07-05 20:13:53
|
The branch, pu, has been updated via 8d295e3c1f7e48ec1793ea6bc59ccf07d39bd55d (commit) via d8140e2c68a3eb77db15e74f6621af6441e19527 (commit) via 8b376ab38ab090763bf0552580374b864e1afea6 (commit) via 393822aa72d8652550d8c88c17240ed19b86593c (commit) from 1510cbb78e7eb882d885b5253fbfd92b6fd38ac0 (commit) - Log ----------------------------------------------------------------- commit 8d295e3c1f7e48ec1793ea6bc59ccf07d39bd55d Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 13:11:22 2010 -0700 Make Makefile generation static again; add needed includes. Dynamic Makefile generation turns into a royal mess -- how does one expand variables, evaluate expressions, etc? Just make things more simplified again by using static definitions in the Makefiles, at the cost of it being more of a PITA to handle. Signed-off-by: Garrett Cooper <yan...@gm...> commit d8140e2c68a3eb77db15e74f6621af6441e19527 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 12:51:21 2010 -0700 Make Makefile gen. depend on the global var defs. Things are going back to being static for simplicity. Signed-off-by: Garrett Cooper <yan...@gm...> commit 8b376ab38ab090763bf0552580374b864e1afea6 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 12:50:54 2010 -0700 Commit dummy files. Signed-off-by: Garrett Cooper <yan...@gm...> commit 393822aa72d8652550d8c88c17240ed19b86593c Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 10:42:30 2010 -0700 Make the _POSIX_SPORADIC_SERVER checks uniform. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../errorLog => open_posix_testsuite/LDFLAGS} | 0 .../errorLog => open_posix_testsuite/LDLIBS} | 0 testcases/open_posix_testsuite/Makefile | 6 ++- .../conformance/interfaces/sched_setparam/25-2.c | 9 ++- .../conformance/interfaces/sched_setparam/25-3.c | 5 +- .../conformance/interfaces/sched_setparam/25-4.c | 9 +++ .../functional/threads/pi_test/CFLAGS | 2 +- .../functional/threads/robust_test/CFLAGS | 1 + .../threads/robust_test}/LDLIBS | 0 .../scripts/generate-makefiles.sh | 52 ++++++++++++++----- 10 files changed, 63 insertions(+), 21 deletions(-) copy testcases/{ballista/ballista/compile/errorLog => open_posix_testsuite/LDFLAGS} (100%) copy testcases/{ballista/ballista/compile/errorLog => open_posix_testsuite/LDLIBS} (100%) create mode 100644 testcases/open_posix_testsuite/functional/threads/robust_test/CFLAGS copy testcases/open_posix_testsuite/{conformance/interfaces/getpid => functional/threads/robust_test}/LDLIBS (100%) diff --git a/testcases/ballista/ballista/compile/errorLog b/testcases/open_posix_testsuite/LDFLAGS similarity index 100% copy from testcases/ballista/ballista/compile/errorLog copy to testcases/open_posix_testsuite/LDFLAGS diff --git a/testcases/ballista/ballista/compile/errorLog b/testcases/open_posix_testsuite/LDLIBS similarity index 100% copy from testcases/ballista/ballista/compile/errorLog copy to testcases/open_posix_testsuite/LDLIBS diff --git a/testcases/open_posix_testsuite/Makefile b/testcases/open_posix_testsuite/Makefile index 50f1c5c..5661d6a 100644 --- a/testcases/open_posix_testsuite/Makefile +++ b/testcases/open_posix_testsuite/Makefile @@ -51,7 +51,11 @@ generate-makefiles: distclean-makefiles @export top_srcdir=$(top_srcdir); \ $(top_srcdir)/scripts/generate-makefiles.sh -$(CRITICAL_MAKEFILES): $(top_srcdir)/scripts/generate-makefiles.sh +$(CRITICAL_MAKEFILES): \ + $(top_srcdir)/scripts/generate-makefiles.sh \ + $(top_srcdir)/CFLAGS \ + $(top_srcdir)/LDFLAGS \ + $(top_srcdir)/LDLIBS $(MAKE) generate-makefiles tools: diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c index 7adfd28..1ba6fce 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c @@ -74,11 +74,14 @@ int main(){ } } -#else -int main() +#elif _POSIX_SPORADIC_SERVER == -1 +int +main (void) { - printf("Does not support SS (SPORADIC SERVER)\n"); + printf("_POSIX_SPORADIC_SERVER support not available\n"); return PTS_UNSUPPORTED; } +#else +#error "_POSIX_SPORADIC_SERVER support not defined" #endif diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c index 4415c03..fd4c6ca 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c @@ -58,9 +58,10 @@ int main(){ #elif _POSIX_SPORADIC_SERVER == -1 int -main(void) { +main (void) +{ printf("_POSIX_SPORADIC_SERVER support not available\n"); - return PTS_UNRESOLVED; + return PTS_UNSUPPORTED; } #else diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c index a0d626a..c97bdd7 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c @@ -73,4 +73,13 @@ int main(){ } +#elif _POSIX_SPORADIC_SERVER == -1 +int +main (void) +{ + printf("_POSIX_SPORADIC_SERVER support not available\n"); + return PTS_UNSUPPORTED; +} +#else +#error "_POSIX_SPORADIC_SERVER not defined properly" #endif diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/CFLAGS b/testcases/open_posix_testsuite/functional/threads/pi_test/CFLAGS index c837c79..a1e2b5c 100644 --- a/testcases/open_posix_testsuite/functional/threads/pi_test/CFLAGS +++ b/testcases/open_posix_testsuite/functional/threads/pi_test/CFLAGS @@ -1 +1 @@ --I../includes +-I"$(srcdir)/../include" diff --git a/testcases/open_posix_testsuite/functional/threads/robust_test/CFLAGS b/testcases/open_posix_testsuite/functional/threads/robust_test/CFLAGS new file mode 100644 index 0000000..a1e2b5c --- /dev/null +++ b/testcases/open_posix_testsuite/functional/threads/robust_test/CFLAGS @@ -0,0 +1 @@ +-I"$(srcdir)/../include" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/getpid/LDLIBS b/testcases/open_posix_testsuite/functional/threads/robust_test/LDLIBS similarity index 100% copy from testcases/open_posix_testsuite/conformance/interfaces/getpid/LDLIBS copy to testcases/open_posix_testsuite/functional/threads/robust_test/LDLIBS diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index 6d79d58..35e69d0 100755 --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -16,9 +16,6 @@ # Garrett Cooper, June 2010 # -AUTHORDATE=$(grep "Garrett Cooper" "$0" | head -n 1 | sed 's,# *,,') -export PATH="$PATH:$(dirname "$0")" - generate_locate_test_makefile() { local maketype=$1; shift @@ -59,16 +56,16 @@ generate_makefile() { cat > "$makefile.1" <<EOF # -# Automatically generated by $(basename "$0") -- DO NOT EDIT. +# Automatically generated by `basename "$0"` -- DO NOT EDIT. # -# Restrictions for $(basename "$0") apply to this file. See COPYING for more +# Restrictions for `basename "$0"` apply to this file. See COPYING for more # details. # # $AUTHORDATE # # Path variables. -top_srcdir?= $(echo "$prereq_dir" | sed -E -e 's,[^/]+,\.\.,g') +top_srcdir?= `echo "$prereq_dir" | sed -E -e 's,[^/]+,\.\.,g'` subdir= $prereq_cache_dir srcdir= \$(top_srcdir)/\$(subdir) @@ -82,17 +79,26 @@ CFLAGS+= -I\$(top_srcdir)/include # XXX: for testfrmw.c -- needs to be moved into a library. CFLAGS+= -I\$(srcdir) -# Include top-level make definitions and submake make definitions. -CFLAGS+= \`cat 2>/dev/null \$(top_srcdir)/CFLAGS\` -CFLAGS+= \`cat 2>/dev/null \$(srcdir)/CFLAGS\` +EOF -LDFLAGS+= \`cat 2>/dev/null \$(top_srcdir)/LDFLAGS\` -LDFLAGS+= \`cat 2>/dev/null \$(srcdir)/LDFLAGS\` + if [ -f "$GLOBAL_BOILERPLATE" ]; then + cat >> "$makefile.1" <<EOF +# Top-level make definitions +`cat $GLOBAL_BOILERPLATE` +EOF + fi -LDLIBS+= \`cat 2>/dev/null \$(top_srcdir)/LDLIBS\` -LDLIBS+= \`cat 2>/dev/null \$(srcdir)/LDLIBS\` + cat >> "$makefile.1" <<EOF +# Submake make definitions. +EOF + for var in CFLAGS LDFLAGS LDLIBS; do + if [ -f "${TOP_SRCDIR}/$var" ]; then + cat >> "$makefile.1" <<EOF +${var}+= `cat "${prereq_cache_dir}/${var}" 2>/dev/null` EOF + fi + done fi @@ -146,7 +152,7 @@ EOF cat >> "$makefile.3" <<EOF $prereq: \$(srcdir)/$c_file - @if $COMPILE_STR >logfile.\$\$\$\$ 2>&1; then \\ + if $COMPILE_STR >logfile.\$\$\$\$ 2>&1; then \\ echo "$prereq_dir/$test_name compile PASSED"; \\ echo "$prereq_dir/$test_name compile PASSED" >> \$(LOGFILE); \\ else \\ @@ -208,13 +214,31 @@ else DEFAULT_PREFIX=/usr/local fi +export PATH="$PATH:`dirname "$0"`" + +AUTHORDATE=`grep "Garrett Cooper" "$0" | head -n 1 | sed 's,# *,,'` PREFIX=${PREFIX:=$DEFAULT_PREFIX/openposix_testsuite} EXEC_PREFIX="${PREFIX}/bin" +TOP_SRCDIR=${TOP_SRCDIR:=`dirname "$0"`/..} + +GLOBAL_BOILERPLATE="${TOP_SRCDIR}/.global_boilerplate" + +rm -f "$GLOBAL_BOILERPLATE" + +for var in CFLAGS LDFLAGS LDLIBS; do + if [ -f "$TOP_SRCDIR/$var" ]; then + cat >> "$GLOBAL_BOILERPLATE" <<EOF +$var+= `cat "$TOP_SRCDIR/$var"` +EOF + fi +done # For the generic cases. generate_locate_test_makefile buildonly "test" -c generate_locate_test_makefile runnable "run-test" +rm -f "$GLOBAL_BOILERPLATE" + find . -name Makefile.1 -exec dirname {} \; | while read dir; do if [ -f "$dir/Makefile.2" ]; then cat $dir/Makefile.1 $dir/Makefile.2 $dir/Makefile.3 > $dir/Makefile hooks/post-receive -- ltp |