From: Szabolcs Nagy Date: Fri, 26 Jul 2013 18:05:41 +0000 (+0000) Subject: add options.h.in to generate posix option group defines X-Git-Url: http://nsz.repo.hu/git/?p=libc-test;a=commitdiff_plain;h=ea45c84bfba9dc8d703e963b18948b886fcd614e add options.h.in to generate posix option group defines --- diff --git a/Makefile b/Makefile index f339aff..8baa9a8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ OBJS:=$(SRCS:src/%.c=$(B)/%.o) DIRS:=$(patsubst src/%/,%,$(sort $(dir $(SRCS)))) BDIRS:=$(DIRS:%=$(B)/%) NAMES:=$(SRCS:src/%.c=%) -CFLAGS:=-Isrc/common +CFLAGS:=-Isrc/common -I$(B)/common LDLIBS:=$(B)/common/libtest.a AR = $(CROSS_COMPILE)ar RANLIB = $(CROSS_COMPILE)ranlib @@ -97,11 +97,15 @@ $(OBJS): src/common/test.h | $(BDIRS) $(BDIRS): mkdir -p $@ +$(B)/common/options.h: src/common/options.h.in + $(CC) -E - <$< | sed -e '1,/optiongroups_unistd_end/d' -e '/^#/d' -e '/^[[:space:]]*$$/d' -e 's/^/#define /' >$@ + $(B)/common/mtest.o: src/common/mtest.h $(math.OBJS): src/common/mtest.h $(B)/api/main: $(api.OBJS) api/main.OBJS:=$(api.OBJS) +$(api.OBJS):$(B)/common/options.h $(api.OBJS):CFLAGS+=-pedantic-errors -Werror -Wno-unused -D_XOPEN_SOURCE=700 $(api.OBJS):CFLAGS+=-DX_PS -DX_TPS -DX_SS diff --git a/src/api/Makefile b/src/api/Makefile index cd1aa1f..c56d353 100644 --- a/src/api/Makefile +++ b/src/api/Makefile @@ -1,4 +1,5 @@ all: %: $(MAKE) -C ../.. B=src src/api/$@ +.SUFFIXES: diff --git a/src/common/Makefile b/src/common/Makefile index 343df71..c4026cc 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -1,4 +1,5 @@ all: %: $(MAKE) -C ../.. B=src src/common/$@ +.SUFFIXES: diff --git a/src/common/options.h.in b/src/common/options.h.in new file mode 100644 index 0000000..711425d --- /dev/null +++ b/src/common/options.h.in @@ -0,0 +1,125 @@ +/* Usage: pipe the output of running the preprocessor on this file to: + * sed -e '1,/optiongroups_unistd_end/d' -e '/^#/d' -e '/^[[:space:]]*$/d' -e 's/^/#define /' + */ +#include +optiongroups_unistd_end + +#if defined _POSIX_ADVISORY_INFO && _POSIX_ADVISORY_INFO >= 0 +POSIX_ADVISORY_INFO _POSIX_ADVISORY_INFO +#endif + +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +POSIX_CPUTIME _POSIX_CPUTIME +#endif + +#if defined _POSIX_FSYNC && _POSIX_FSYNC >= 0 +POSIX_FSYNC _POSIX_FSYNC +#endif + +#if defined _POSIX_IPV6 && _POSIX_IPV6 >= 0 +POSIX_IPV6 _POSIX_IPV6 +#endif + +#if defined _POSIX_MEMLOCK && _POSIX_MEMLOCK >= 0 +POSIX_MEMLOCK _POSIX_MEMLOCK +#endif + +#if defined _POSIX_MEMLOCK_RANGE && _POSIX_MEMLOCK_RANGE >= 0 +POSIX_MEMLOCK_RANGE _POSIX_MEMLOCK_RANGE +#endif + +#if defined _POSIX_MESSAGE_PASSING && _POSIX_MESSAGE_PASSING >= 0 +POSIX_MESSAGE_PASSING _POSIX_MESSAGE_PASSING +#endif + +#if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0 +POSIX_MONOTONIC_CLOCK _POSIX_MONOTONIC_CLOCK +#endif + +#if defined _POSIX_PRIORITIZED_IO && _POSIX_PRIORITIZED_IO >= 0 +POSIX_PRIORITIZED_IO _POSIX_PRIORITIZED_IO +#endif + +#if defined _POSIX_PRIORITY_SCHEDULING && _POSIX_PRIORITY_SCHEDULING >= 0 +POSIX_PRIORITY_SCHEDULING _POSIX_PRIORITY_SCHEDULING +#endif + +#if defined _POSIX_RAW_SOCKETS && _POSIX_RAW_SOCKETS >= 0 +POSIX_RAW_SOCKETS _POSIX_RAW_SOCKETS +#endif + +#if defined _POSIX_SHARED_MEMORY_OBJECTS && _POSIX_SHARED_MEMORY_OBJECTS >= 0 +POSIX_SHARED_MEMORY_OBJECTS _POSIX_SHARED_MEMORY_OBJECTS +#endif + +#if defined _POSIX_SPAWN && _POSIX_SPAWN >= 0 +POSIX_SPAWN _POSIX_SPAWN +#endif + +#if defined _POSIX_SPORADIC_SERVER && _POSIX_SPORADIC_SERVER >= 0 +POSIX_SPORADIC_SERVER _POSIX_SPORADIC_SERVER +#endif + +#if defined _POSIX_SYNCHRONIZED_IO && _POSIX_SYNCHRONIZED_IO >= 0 +POSIX_SYNCHRONIZED_IO _POSIX_SYNCHRONIZED_IO +#endif + +#if defined _POSIX_THREAD_ATTR_STACKADDR && _POSIX_THREAD_ATTR_STACKADDR >= 0 +POSIX_THREAD_ATTR_STACKADDR _POSIX_THREAD_ATTR_STACKADDR +#endif + +#if defined _POSIX_THREAD_ATTR_STACKSIZE && _POSIX_THREAD_ATTR_STACKSIZE >= 0 +POSIX_THREAD_ATTR_STACKSIZE _POSIX_THREAD_ATTR_STACKSIZE +#endif + +#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 +POSIX_THREAD_CPUTIME _POSIX_THREAD_CPUTIME +#endif + +#if defined _POSIX_THREAD_PRIO_INHERIT && _POSIX_THREAD_PRIO_INHERIT >= 0 +POSIX_THREAD_PRIO_INHERIT _POSIX_THREAD_PRIO_INHERIT +#endif + +#if defined _POSIX_THREAD_PRIO_PROTECT && _POSIX_THREAD_PRIO_PROTECT >= 0 +POSIX_THREAD_PRIO_PROTECT _POSIX_THREAD_PRIO_PROTECT +#endif + +#if defined _POSIX_THREAD_PRIORITY_SCHEDULING && _POSIX_THREAD_PRIORITY_SCHEDULING >= 0 +POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_THREAD_PRIORITY_SCHEDULING +#endif + +#if defined _POSIX_THREAD_PROCESS_SHARED && _POSIX_THREAD_PROCESS_SHARED >= 0 +POSIX_THREAD_PROCESS_SHARED _POSIX_THREAD_PROCESS_SHARED +#endif + +#if defined _POSIX_THREAD_ROBUST_PRIO_INHERIT && _POSIX_THREAD_ROBUST_PRIO_INHERIT >= 0 +POSIX_THREAD_ROBUST_PRIO_INHERIT _POSIX_THREAD_ROBUST_PRIO_INHERIT +#endif + +#if defined _POSIX_THREAD_ROBUST_PRIO_PROTECT && _POSIX_THREAD_ROBUST_PRIO_PROTECT >= 0 +POSIX_THREAD_ROBUST_PRIO_PROTECT _POSIX_THREAD_ROBUST_PRIO_PROTECT +#endif + +#if defined _POSIX_THREAD_SPORADIC_SERVER && _POSIX_THREAD_SPORADIC_SERVER >= 0 +POSIX_THREAD_SPORADIC_SERVER _POSIX_THREAD_SPORADIC_SERVER +#endif + +#if defined _POSIX_TYPED_MEMORY_OBJECTS && _POSIX_TYPED_MEMORY_OBJECTS >= 0 +POSIX_TYPED_MEMORY_OBJECTS _POSIX_TYPED_MEMORY_OBJECTS +#endif + +#if defined _XOPEN_CRYPT && _XOPEN_CRYPT >= 0 +XOPEN_CRYPT _XOPEN_CRYPT +#endif + +#if defined _XOPEN_REALTIME && _XOPEN_REALTIME >= 0 +XOPEN_REALTIME _XOPEN_REALTIME +#endif + +#if defined _XOPEN_REALTIME_THREADS && _XOPEN_REALTIME_THREADS >= 0 +XOPEN_REALTIME_THREADS _XOPEN_REALTIME_THREADS +#endif + +#if defined _XOPEN_UNIX && _XOPEN_UNIX >= 0 +XOPEN_UNIX _XOPEN_UNIX +#endif diff --git a/src/functional/Makefile b/src/functional/Makefile index e0d02f9..31ce38d 100644 --- a/src/functional/Makefile +++ b/src/functional/Makefile @@ -1,4 +1,5 @@ all: %: $(MAKE) -C ../.. B=src src/functional/$@ +.SUFFIXES: diff --git a/src/math/Makefile b/src/math/Makefile index 44fb35b..998b7f4 100644 --- a/src/math/Makefile +++ b/src/math/Makefile @@ -1,4 +1,5 @@ all: %: $(MAKE) -C ../.. B=src src/math/$@ +.SUFFIXES: diff --git a/src/regression/Makefile b/src/regression/Makefile index d0ff541..8f5d911 100644 --- a/src/regression/Makefile +++ b/src/regression/Makefile @@ -1,4 +1,5 @@ all: %: $(MAKE) -C ../.. B=src src/regression/$@ +.SUFFIXES: