summaryrefslogtreecommitdiff
path: root/project/config
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-09 02:37:43 -0500
committermidipix <writeonce@midipix.org>2018-12-09 02:37:43 -0500
commit2688847c63beac9df94fc81cdeb29fb4307fcb3c (patch)
tree2323e55ac5ce2bf6203f3fda8e038b7989361d9b /project/config
parent3ff374c4bac12464bc05372c8728e6638774a66f (diff)
downloadsbpython2-2688847c63beac9df94fc81cdeb29fb4307fcb3c.tar.bz2
sbpython2-2688847c63beac9df94fc81cdeb29fb4307fcb3c.tar.xz
config: linux (and otherwise): detect absence of stropts.h.
Diffstat (limited to 'project/config')
-rw-r--r--project/config/cfgdefs.sh21
1 files changed, 21 insertions, 0 deletions
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