Add Newlib test

This commit is contained in:
Jeffrey Walton 2018-11-17 15:50:04 -05:00
parent 0c6dc33d2b
commit 889c98b9af
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 18 additions and 10 deletions

View File

@ -175,19 +175,10 @@ ifeq ($(ARFLAGS),rv)
ARFLAGS = r
endif
# Newlib needs _XOPEN_SOURCE=600 for signals
TPROG = TestPrograms/test_cxx.cxx
HAS_NEWLIB := $(shell $(CXX) $(CXXFLAGS) -dM -E $(TPROG) 2>&1 | $(GREP) -i -c "__NEWLIB__")
ifneq ($(HAS_NEWLIB),0)
ifeq ($(findstring -D_XOPEN_SOURCE,$(CXXFLAGS)),)
CXXFLAGS += -D_XOPEN_SOURCE=600
endif
endif
# Clang integrated assembler will be used with -Wa,-q
CLANG_INTEGRATED_ASSEMBLER ?= 0
# original MinGW targets Win2k by default, but lacks proper Win2k support
# Original MinGW targets Win2k by default, but lacks proper Win2k support
# if target Windows version is not specified, use Windows XP instead
ifeq ($(IS_MINGW),1)
ifeq ($(findstring -D_WIN32_WINNT,$(CXXFLAGS)),)
@ -201,6 +192,15 @@ endif # _WIN32_WINDOWS
endif # _WIN32_WINNT
endif # IS_MINGW
# Newlib needs _XOPEN_SOURCE=600 for signals
TPROG = TestPrograms/test_newlib.cxx
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
ifeq ($(HAVE_OPT),0)
ifeq ($(findstring -D_XOPEN_SOURCE,$(CXXFLAGS)),)
CXXFLAGS += -D_XOPEN_SOURCE=600
endif
endif
###########################################################
##### X86/X32/X64 Options #####
###########################################################

View File

@ -0,0 +1,8 @@
#include <string>
int main(int argc, char* argv[])
{
#ifndef __NEWLIB__
XXX
#endif
return 0;
}