_XOPEN_SOURCE=500 is passed to CXX and results in error "#error "Compiler or options invalid for pre-UNIX 03 X/Open applications" 1. There is a workaround for c++/Makefile in ebuild, but it fails if USE=-cxx 2. Similar workaround is required on configure step. Reproducible: Always Steps to Reproduce: emerge ncurses Actual Results: checking whether i386-pc-solaris2.11-g++ understands -c and -o together... yes checking how to run the C++ preprocessor... /lib/cpp configure: error: C++ preprocessor "/lib/cpp" fails sanity check !!! Please attach the following file when seeking support: !!! /nef/var/tmp/portage/sys-libs/ncurses-5.9-r3/work/narrowc/config.log * ERROR: sys-libs/ncurses-5.9-r3 failed (compile phase): * econf failed NOTE: configure looks for "/lib/cpp" because "$CXX -E" failed. And "$CXX -E" failed because of _XOPEN_SOURCE=500
Created attachment 321286 [details] config.log
As for fix in c++/Makefile: ebuild should test whether c++/Makefile exists, and then try to fix it.
that sounds reasonable, but wouldn't if use cxx ; then sed .... fi be more sensical then?
(In reply to comment #3) > that sounds reasonable, but wouldn't > > if use cxx ; then > sed .... > fi > > be more sensical then? Yes, I thinks so.
It is safe to completely remove -D_XOPEN_SOURCE from configure for *-solaris*
that needs checking, gcc-4.6 required me to add that nasty bit
(In reply to comment #6) > that needs checking, gcc-4.6 required me to add that nasty bit I've checked this with GCC 4.6.3 (both CC and CXX). AFAIK, Python does similar thing: defines __EXTENSIONS__ instead of any _XOPEN_SOURCE
ok, I have to backtrack here. We remove -D_XOPEN_SOURCE=500 on solaris, beacuse it breaks the c++ (due to _XOPEN_SOURCE=600 being standard with c++). I seem to recall, I could not remove it from configure or something. Do you see a way?
(In reply to comment #8) > ok, I have to backtrack here. > > We remove -D_XOPEN_SOURCE=500 on solaris, beacuse it breaks the c++ (due to > _XOPEN_SOURCE=600 being standard with c++). > > I seem to recall, I could not remove it from configure or something. Do you > see a way? I do this: if [[ ${CHOST} == *-solaris* ]] ; then sed -i -e '/-D__EXTENSIONS__/ s/-D_XOPEN_SOURCE=\$cf_XOPEN_SOURCE//' configure || die fi It's just a fast hack. NCurses should be patched to be more careful. BTW, in illumos/solaris headers each test for _XOPEN_SOURCE is accompanied with "|| defined(__EXTENSIONS__)"
fixed in ncurses-5.9-r02.1, I hope it doesn't break.
it does ... on OpenIndiana 151a5
make: Entering directory `/home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/widec/c++' i386-pc-solaris2.11-g++ -I../c++ -I../include -I/home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++ -DHAVE_CONFIG_H -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64 -DXTSTRINGDEFINES -DNDEBUG -I. -I../include -I/home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/../include -I/home/gentoo/usr/include/ncursesw -O2 -pipe -W -Wall -Wabi -fabi-version=0 -Woverloaded-virtual -Wsign-promo -Wsynth -Wold-style-cast -Wcast-align -Wcast-qual -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Weffc++ -Wno-unused -fPIC -c /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.cc -o ../obj_s/cursesf.o In file included from /usr/include/iso/stdlib_iso.h:48:0, from /usr/include/stdlib.h:32, from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/internal.h:53, from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.cc:34: /home/gentoo/usr/lib/gcc/i386-pc-solaris2.11/4.6.3/include-fixed/sys/feature_tests.h:362:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications" In file included from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.h:39:0, from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.cc:35: This is a fresh 32-bits bootstrap on OpenIndiana where the emerge -e system stage goes wrong :(
and it fails exactly the same way on an existing OpenIndiana Prefix, 64-bits, using GCC 4.7.1.
-D_XOPEN_SOURCE_EXTENDED kills sys/feature_tests.h, because that means the system would be prehistoric level (pre _XOPEN_SOURCE=500) X/Open CAE Specification, Issue 4, Version 2.
Fixed forgood, now, I hope.