From 2688847c63beac9df94fc81cdeb29fb4307fcb3c Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 9 Dec 2018 02:37:43 -0500 Subject: config: linux (and otherwise): detect absence of stropts.h. --- config/x86_64-linux/pyconfig.h | 1 + profiles/osapi/overrides.h | 9 +++++++++ project/config/cfgdefs.sh | 21 +++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 profiles/osapi/overrides.h diff --git a/config/x86_64-linux/pyconfig.h b/config/x86_64-linux/pyconfig.h index 04acdb7..0ed7498 100644 --- a/config/x86_64-linux/pyconfig.h +++ b/config/x86_64-linux/pyconfig.h @@ -3,6 +3,7 @@ #include "osapi/modern.h" #include "osapi/linux.h" +#include "osapi/overrides.h" #include "toolchain/64-default.h" #include "toolchain/64-le-ieee.h" diff --git a/profiles/osapi/overrides.h b/profiles/osapi/overrides.h new file mode 100644 index 0000000..0675c79 --- /dev/null +++ b/profiles/osapi/overrides.h @@ -0,0 +1,9 @@ +#ifndef PY_OSAPI_OVERRIDES_H +#define PY_OSAPI_OVERRIDES_H + +/* stropts.h */ +#ifdef HAVE_NO_STROPTS_H +#undef HAVE_STROPTS_H +#endif + +#endif diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh index 00dbde5..62a4d21 100644 --- a/project/config/cfgdefs.sh +++ b/project/config/cfgdefs.sh @@ -51,5 +51,26 @@ sed -e 's^@pycompile_cfghost@^'"$mb_pycompile_cfghost"'^g' \ > $mb_pwd/cfgdefs.mk || exit 2 +# system tests: target +mb_cfgdefs_cc=$(make -s -f Makefile.tmp .display-cc) +mb_cfgdefs_cflags=$(make -s -f Makefile.tmp .display-cflags) + +printf '\n\n#system tests: target\n' >> $mb_pwd/cfgdefs.mk + +$mb_cfgdefs_cc $mb_cfgdefs_cflags -E -xc - \ + --include=stropts.h < /dev/null \ + > /dev/null 2>/dev/null || \ + printf 'CFLAGS_CONFIG\t\t+= -DHAVE_NO_STROPTS_H\n' \ + >> $mb_pwd/cfgdefs.mk + +# system tests: (native) pycompile +printf '\n\n#system tests: (native) pycompile\n' >> $mb_pwd/cfgdefs.mk + +$mb_native_cc -E -xc - \ + --include=stropts.h < /dev/null \ + > /dev/null 2>/dev/null || \ + printf 'PYCOMPILE_CFLAGS\t+= -DHAVE_NO_STROPTS_H\n' \ + >> $mb_pwd/cfgdefs.mk + # all done return 0 -- cgit v1.2.3