From b7773efdc1b819c627810dffe29cf9c00281bfcc Mon Sep 17 00:00:00 2001 From: GCC-XML Date: Fri, 12 Jun 2009 13:33:35 -0400 Subject: [PATCH] gccxml 2009-06-12 (eb4513ee) --- GCC/libdecnumber/gstdint.h | 8 +- GCC/libiberty/physmem.c | 14 +- GCC_XML/GXFront/gxConfiguration.cxx | 2 +- GCC_XML/KWSys/CMakeLists.txt | 6 + GCC_XML/KWSys/ProcessUNIX.c | 105 +++++++-- GCC_XML/KWSys/String.c | 12 +- GCC_XML/KWSys/SystemTools.cxx | 76 ++++++- GCC_XML/KWSys/SystemTools.hxx.in | 4 + GCC_XML/KWSys/hashtable.hxx.in | 8 +- GCC_XML/KWSys/kwsysDateStamp.cmake | 4 +- GCC_XML/KWSys/kwsysPrivate.h | 4 +- GCC_XML/KWSys/testAutoPtr.cxx | 5 +- GCC_XML/Support/CMakeLists.txt | 5 +- GCC_XML/Support/IBM/8.0/adapt_headers.sh | 34 +++ GCC_XML/Support/IBM/8.0/stdlib.h.patch | 27 +++ GCC_XML/Support/IBM/8.0/xstring.patch | 19 ++ GCC_XML/Support/IBM/README | 8 + GCC_XML/Support/IBM/find_flags | 51 +++++ GCC_XML/Support/IBM/find_flags_common | 48 +++++ .../Sun/5.8/{adaptation.patch => Cstd.patch} | 204 +++++++++--------- GCC_XML/Support/Sun/5.8/adapt_headers.sh | 32 +++ GCC_XML/Support/Sun/5.8/std-5.10.patch | 22 ++ GCC_XML/Support/Sun/README | 8 +- GCC_XML/Support/Sun/adapt_headers.sh | 24 --- GCC_XML/Support/Sun/find_flags | 54 ++--- GCC_XML/Support/Sun/find_flags_common | 42 ++++ GCC_XML/Support/gccxml_identify_compiler.cc | 2 + GCC_XML/VcInstall/gccxml_vcupdate.bat.in | 23 +- 28 files changed, 631 insertions(+), 220 deletions(-) create mode 100755 GCC_XML/Support/IBM/8.0/adapt_headers.sh create mode 100644 GCC_XML/Support/IBM/8.0/stdlib.h.patch create mode 100644 GCC_XML/Support/IBM/8.0/xstring.patch create mode 100644 GCC_XML/Support/IBM/README create mode 100755 GCC_XML/Support/IBM/find_flags create mode 100755 GCC_XML/Support/IBM/find_flags_common rename GCC_XML/Support/Sun/5.8/{adaptation.patch => Cstd.patch} (51%) create mode 100755 GCC_XML/Support/Sun/5.8/adapt_headers.sh create mode 100644 GCC_XML/Support/Sun/5.8/std-5.10.patch delete mode 100755 GCC_XML/Support/Sun/adapt_headers.sh create mode 100755 GCC_XML/Support/Sun/find_flags_common diff --git a/GCC/libdecnumber/gstdint.h b/GCC/libdecnumber/gstdint.h index 707171a..c51ad4a 100644 --- a/GCC/libdecnumber/gstdint.h +++ b/GCC/libdecnumber/gstdint.h @@ -1,4 +1,4 @@ -/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:49) */ +/* BEGIN GCC-XML MODIFICATIONS (2009/06/09 18:18:01) */ /* This file was manually written for gccxml's GCC. */ #ifndef GCC_GSTDINT_H #define GCC_GSTDINT_H 1 @@ -14,9 +14,11 @@ typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; -#else +#elif defined(HAVE_STDINT_H) # include +#elif defined(HAVE_INTTYPES_H) +# include #endif #endif /* GCC_GSTDINT_H */ -/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:49) */ +/* END GCC-XML MODIFICATIONS (2009/06/09 18:18:01) */ diff --git a/GCC/libiberty/physmem.c b/GCC/libiberty/physmem.c index 2d498bc..8185d21 100644 --- a/GCC/libiberty/physmem.c +++ b/GCC/libiberty/physmem.c @@ -73,13 +73,13 @@ typedef struct DWORDLONG ullAvailVirtual; DWORDLONG ullAvailExtendedVirtual; } lMEMORYSTATUSEX; -/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:51) */ +/* BEGIN GCC-XML MODIFICATIONS (2009/06/09 18:18:45) */ # if !defined(_MSC_VER) && !defined(__BORLANDC__) typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*); # else typedef BOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*); # endif -/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:51) */ +/* END GCC-XML MODIFICATIONS (2009/06/09 18:18:45) */ #endif #include "libiberty.h" @@ -150,7 +150,7 @@ physmem_total (void) } #endif -#if HAVE__SYSTEM_CONFIGURATION +#ifdef HAVE__SYSTEM_CONFIGURATION /* This works on AIX 4.3.3+. */ return _system_configuration.physmem; #endif @@ -170,13 +170,13 @@ physmem_total (void) lms_ex.dwLength = sizeof lms_ex; if (!pfnex (&lms_ex)) return 0.0; -/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:51) */ +/* BEGIN GCC-XML MODIFICATIONS (2009/06/09 18:18:45) */ #if !defined(_MSC_VER) || _MSC_VER >= 1300 return (double) lms_ex.ullTotalPhys; #else return (double)(signed __int64) lms_ex.ullTotalPhys; #endif -/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:51) */ +/* END GCC-XML MODIFICATIONS (2009/06/09 18:18:45) */ } /* Fall back to GlobalMemoryStatus which is always available. @@ -277,13 +277,13 @@ physmem_available (void) lms_ex.dwLength = sizeof lms_ex; if (!pfnex (&lms_ex)) return 0.0; -/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:51) */ +/* BEGIN GCC-XML MODIFICATIONS (2009/06/09 18:18:45) */ #if !defined(_MSC_VER) || _MSC_VER >= 1300 return (double) lms_ex.ullAvailPhys; #else return (double)(signed __int64) lms_ex.ullAvailPhys; #endif -/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:51) */ +/* END GCC-XML MODIFICATIONS (2009/06/09 18:18:45) */ } /* Fall back to GlobalMemoryStatus which is always available. diff --git a/GCC_XML/GXFront/gxConfiguration.cxx b/GCC_XML/GXFront/gxConfiguration.cxx index 4dd8353..456b1b7 100644 --- a/GCC_XML/GXFront/gxConfiguration.cxx +++ b/GCC_XML/GXFront/gxConfiguration.cxx @@ -1022,7 +1022,7 @@ std::string gxConfiguration::GetCompilerId() if(gxSystemTools::RunCommand(cmd.c_str(), output, retVal) && (0 == retVal)) { gxsys::RegularExpression reId; - reId.compile("GCCXML_SUPPORT=\"(.*)\""); + reId.compile("GCCXML_SUPPORT[ ]*=[ ]*\"(.*)\""); std::vector lines = gxSystemTools::SplitString(output.c_str(), '\n'); std::vector::iterator it; diff --git a/GCC_XML/KWSys/CMakeLists.txt b/GCC_XML/KWSys/CMakeLists.txt index 645a419..145e43a 100644 --- a/GCC_XML/KWSys/CMakeLists.txt +++ b/GCC_XML/KWSys/CMakeLists.txt @@ -848,6 +848,12 @@ ENDIF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) # line to configure the namespace in the C and C++ source files. ADD_DEFINITIONS("-DKWSYS_NAMESPACE=${KWSYS_NAMESPACE}") +IF(KWSYS_USE_String) + # Activate code in "String.c". See the comment in the source. + SET_SOURCE_FILES_PROPERTIES(String.c PROPERTIES + COMPILE_FLAGS "-DKWSYS_STRING_C") +ENDIF(KWSYS_USE_String) + #----------------------------------------------------------------------------- # Process execution on windows needs to build a forwarding executable # that works around a Win9x bug. We encode the executable into a C diff --git a/GCC_XML/KWSys/ProcessUNIX.c b/GCC_XML/KWSys/ProcessUNIX.c index 76b5848..18bbad7 100644 --- a/GCC_XML/KWSys/ProcessUNIX.c +++ b/GCC_XML/KWSys/ProcessUNIX.c @@ -67,6 +67,12 @@ do. #undef __BEOS__ #endif +#if defined(__VMS) +# define KWSYSPE_VMS_NONBLOCK , O_NONBLOCK +#else +# define KWSYSPE_VMS_NONBLOCK +#endif + #if defined(KWSYS_C_HAS_PTRDIFF_T) && KWSYS_C_HAS_PTRDIFF_T typedef ptrdiff_t kwsysProcess_ptrdiff_t; #else @@ -100,7 +106,7 @@ static inline void kwsysProcess_usleep(unsigned int msec) * pipes' file handles to be non-blocking and just poll them directly * without select(). */ -#if !defined(__BEOS__) +#if !defined(__BEOS__) && !defined(__VMS) # define KWSYSPE_USE_SELECT 1 #endif @@ -156,7 +162,8 @@ static int kwsysProcessGetTimeoutTime(kwsysProcess* cp, double* userTimeout, kwsysProcessTime* timeoutTime); static int kwsysProcessGetTimeoutLeft(kwsysProcessTime* timeoutTime, double* userTimeout, - kwsysProcessTimeNative* timeoutLength); + kwsysProcessTimeNative* timeoutLength, + int zeroIsExpired); static kwsysProcessTime kwsysProcessTimeGetCurrent(void); static double kwsysProcessTimeToDouble(kwsysProcessTime t); static kwsysProcessTime kwsysProcessTimeFromDouble(double d); @@ -169,6 +176,7 @@ static void kwsysProcessRestoreDefaultSignalHandlers(void); static pid_t kwsysProcessFork(kwsysProcess* cp, kwsysProcessCreateInformation* si); static void kwsysProcessKill(pid_t process_id); +static int kwsysProcessSetVMSFeature(const char* name, int value); static int kwsysProcessesAdd(kwsysProcess* cp); static void kwsysProcessesRemove(kwsysProcess* cp); #if KWSYSPE_USE_SIGINFO @@ -719,6 +727,13 @@ void kwsysProcess_Execute(kwsysProcess* cp) return; } + /* Make sure pipes behave like streams on VMS. */ + if(!kwsysProcessSetVMSFeature("DECC$STREAM_PIPE", 1)) + { + kwsysProcessCleanup(cp, 1); + return; + } + /* Save the real working directory of this process and change to the working directory for the child processes. This is needed to make pipe file paths evaluate correctly. */ @@ -758,7 +773,7 @@ void kwsysProcess_Execute(kwsysProcess* cp) { /* Create the pipe. */ int p[2]; - if(pipe(p) < 0) + if(pipe(p KWSYSPE_VMS_NONBLOCK) < 0) { kwsysProcessCleanup(cp, 1); return; @@ -1097,7 +1112,7 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length, } if(kwsysProcessGetTimeoutLeft(&wd->TimeoutTime, wd->User?wd->UserTimeout:0, - &timeoutLength)) + &timeoutLength, 0)) { /* Timeout has already expired. */ wd->Expired = 1; @@ -1184,11 +1199,24 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length, else if (n == 0) /* EOF */ { /* We are done reading from this pipe. */ - kwsysProcessCleanupDescriptor(&cp->PipeReadEnds[i]); - --cp->PipesLeft; +#if defined(__VMS) + if(!cp->CommandsLeft) +#endif + { + kwsysProcessCleanupDescriptor(&cp->PipeReadEnds[i]); + --cp->PipesLeft; + } } else if (n < 0) /* error */ { +#if defined(__VMS) + if(!cp->CommandsLeft) + { + kwsysProcessCleanupDescriptor(&cp->PipeReadEnds[i]); + --cp->PipesLeft; + } + else +#endif if((errno != EINTR) && (errno != EAGAIN)) { strncpy(cp->ErrorMessage,strerror(errno), @@ -1210,14 +1238,7 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length, } if(kwsysProcessGetTimeoutLeft(&wd->TimeoutTime, wd->User?wd->UserTimeout:0, - &timeoutLength)) - { - /* Timeout has already expired. */ - wd->Expired = 1; - return 1; - } - - if((timeoutLength.tv_sec == 0) && (timeoutLength.tv_usec == 0)) + &timeoutLength, 1)) { /* Timeout has already expired. */ wd->Expired = 1; @@ -1571,6 +1592,11 @@ static int kwsysProcessSetNonBlocking(int fd) return flags >= 0; } +/*--------------------------------------------------------------------------*/ +#if defined(__VMS) +int decc$set_child_standard_streams(int fd1, int fd2, int fd3); +#endif + /*--------------------------------------------------------------------------*/ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex, kwsysProcessCreateInformation* si, int* readEnd) @@ -1622,7 +1648,7 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex, { /* Create the pipe. */ int p[2]; - if(pipe(p) < 0) + if(pipe(p KWSYSPE_VMS_NONBLOCK) < 0) { return 0; } @@ -1680,7 +1706,14 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex, } /* Fork off a child process. */ +#if defined(__VMS) + /* VMS needs vfork and execvp to be in the same function because + they use setjmp/longjmp to run the child startup code in the + parent! TODO: OptionDetach. */ + cp->ForkPIDs[prIndex] = vfork(); +#else cp->ForkPIDs[prIndex] = kwsysProcessFork(cp, si); +#endif if(cp->ForkPIDs[prIndex] < 0) { return 0; @@ -1688,6 +1721,10 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex, if(cp->ForkPIDs[prIndex] == 0) { +#if defined(__VMS) + /* Specify standard pipes for child process. */ + decc$set_child_standard_streams(si->StdIn, si->StdOut, si->StdErr); +#else /* Close the read end of the error reporting pipe. */ close(si->ErrorPipe[0]); @@ -1717,14 +1754,21 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex, /* Restore all default signal handlers. */ kwsysProcessRestoreDefaultSignalHandlers(); +#endif /* Execute the real process. If successful, this does not return. */ execvp(cp->Commands[prIndex][0], cp->Commands[prIndex]); + /* TODO: What does VMS do if the child fails to start? */ /* Failure. Report error to parent and terminate. */ kwsysProcessChildErrorExit(si->ErrorPipe[1]); } +#if defined(__VMS) + /* Restore the standard pipes of this process. */ + decc$set_child_standard_streams(0, 1, 2); +#endif + /* A child has been created. */ ++cp->CommandsLeft; @@ -1905,7 +1949,8 @@ static int kwsysProcessGetTimeoutTime(kwsysProcess* cp, double* userTimeout, Returns 1 if the time has already arrived, and 0 otherwise. */ static int kwsysProcessGetTimeoutLeft(kwsysProcessTime* timeoutTime, double* userTimeout, - kwsysProcessTimeNative* timeoutLength) + kwsysProcessTimeNative* timeoutLength, + int zeroIsExpired) { if(timeoutTime->tv_sec < 0) { @@ -1925,7 +1970,8 @@ static int kwsysProcessGetTimeoutLeft(kwsysProcessTime* timeoutTime, timeLeft.tv_usec = 0; } - if(timeLeft.tv_sec < 0) + if(timeLeft.tv_sec < 0 || + (timeLeft.tv_sec == 0 && timeLeft.tv_usec == 0 && zeroIsExpired)) { /* Timeout has already expired. */ return 1; @@ -2270,9 +2316,6 @@ static pid_t kwsysProcessFork(kwsysProcess* cp, if(cp->OptionDetach) { /* Create an intermediate process. */ -#ifdef __VMS -#define fork vfork -#endif pid_t middle_pid = fork(); if(middle_pid < 0) { @@ -2440,6 +2483,26 @@ static void kwsysProcessKill(pid_t process_id) } } +/*--------------------------------------------------------------------------*/ +#if defined(__VMS) +int decc$feature_get_index(char *name); +int decc$feature_set_value(int index, int mode, int value); +static int kwsysProcessSetVMSFeature(const char* name, int value) +{ + int i; + errno = 0; + i = decc$feature_get_index(name); + return i >= 0 && (decc$feature_set_value(i, 1, value) >= 0 || errno == 0); +} +#else +static int kwsysProcessSetVMSFeature(const char* name, int value) +{ + (void)name; + (void)value; + return 1; +} +#endif + /*--------------------------------------------------------------------------*/ /* Global set of executing processes for use by the signal handler. This global instance will be zero-initialized by the compiler. */ @@ -2481,7 +2544,7 @@ static int kwsysProcessesAdd(kwsysProcess* cp) { /* Create the pipe. */ int p[2]; - if(pipe(p) < 0) + if(pipe(p KWSYSPE_VMS_NONBLOCK) < 0) { return 0; } diff --git a/GCC_XML/KWSys/String.c b/GCC_XML/KWSys/String.c index 2df1178..b3503ef 100644 --- a/GCC_XML/KWSys/String.c +++ b/GCC_XML/KWSys/String.c @@ -11,6 +11,14 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#ifdef KWSYS_STRING_C +/* +All code in this source file is conditionally compiled to work-around +template definition auto-search on VMS. Other source files in this +directory that use the stl string cause the compiler to load this +source to try to get the definition of the string template. This +condition blocks the compiler from seeing the symbols defined here. +*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(String.h) @@ -78,7 +86,7 @@ int kwsysString_strcasecmp(const char* lhs, const char* rhs) const char* const lower = kwsysString_strcasecmp_tolower; unsigned char const* us1 = (unsigned char const*)lhs; unsigned char const* us2 = (unsigned char const*)rhs; - int result = 0; + int result; while((result = lower[*us1] - lower[*us2++], result == 0) && *us1++) { } @@ -105,3 +113,5 @@ int kwsysString_strncasecmp(const char* lhs, const char* rhs, size_t n) return result; #endif } + +#endif /* KWSYS_STRING_C */ diff --git a/GCC_XML/KWSys/SystemTools.cxx b/GCC_XML/KWSys/SystemTools.cxx index 2fddfb8..3dbdf02 100644 --- a/GCC_XML/KWSys/SystemTools.cxx +++ b/GCC_XML/KWSys/SystemTools.cxx @@ -402,9 +402,36 @@ bool SystemTools::GetEnv(const char* key, kwsys_stl::string& result) } } +class kwsysDeletingCharVector : public kwsys_stl::vector +{ +public: + ~kwsysDeletingCharVector(); +}; + +kwsysDeletingCharVector::~kwsysDeletingCharVector() +{ + for(kwsys_stl::vector::iterator i = this->begin(); + i != this->end(); ++i) + { + delete []*i; + } +} +bool SystemTools::PutEnv(const char* value) +{ + static kwsysDeletingCharVector localEnvironment; + char* envVar = new char[strlen(value)+1]; + strcpy(envVar, value); + int ret = putenv(envVar); + // save the pointer in the static vector so that it can + // be deleted on exit + localEnvironment.push_back(envVar); + return ret == 0; +} + + const char* SystemTools::GetExecutableExtension() { -#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(_WIN32) || defined(__CYGWIN__) || defined(__VMS) return ".exe"; #else return ""; @@ -1456,12 +1483,38 @@ kwsys_stl::string SystemTools::EscapeChars( return n; } +#ifdef __VMS +static void ConvertVMSToUnix(kwsys_stl::string& path) +{ + kwsys_stl::string::size_type rootEnd = path.find(":["); + kwsys_stl::string::size_type pathEnd = path.find("]"); + if(rootEnd != path.npos) + { + kwsys_stl::string root = path.substr(0, rootEnd); + kwsys_stl::string pathPart = path.substr(rootEnd+2, pathEnd - rootEnd-2); + const char* pathCString = pathPart.c_str(); + const char* pos0 = pathCString; + for (kwsys_stl::string::size_type pos = 0; *pos0; ++ pos ) + { + if ( *pos0 == '.' ) + { + pathPart[pos] = '/'; + } + pos0 ++; + } + path = "/"+ root + "/" + pathPart; + } +} +#endif + // convert windows slashes to unix slashes void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path) { const char* pathCString = path.c_str(); bool hasDoubleSlash = false; - +#ifdef __VMS + ConvertVMSToUnix(path); +#else const char* pos0 = pathCString; const char* pos1 = pathCString+1; for (kwsys_stl::string::size_type pos = 0; *pos0; ++ pos ) @@ -1495,7 +1548,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path) { SystemTools::ReplaceString(path, "//", "/"); } - +#endif // remove any trailing slash if(!path.empty()) { @@ -4507,8 +4560,25 @@ SystemToolsManager::~SystemToolsManager() } } +#if defined(__VMS) +// On VMS we configure the run time C library to be more UNIX like. +// http://h71000.www7.hp.com/doc/732final/5763/5763pro_004.html +extern "C" int decc$feature_get_index(char *name); +extern "C" int decc$feature_set_value(int index, int mode, int value); +static int SetVMSFeature(char* name, int value) +{ + int i; + errno = 0; + i = decc$feature_get_index(name); + return i >= 0 && (decc$feature_set_value(i, 1, value) >= 0 || errno == 0); +} +#endif + void SystemTools::ClassInitialize() { +#ifdef __VMS + SetVMSFeature("DECC$FILENAME_UNIX_ONLY", 1); +#endif // Allocate the translation map first. SystemTools::TranslationMap = new SystemToolsTranslationMap; SystemTools::LongPathMap = new SystemToolsTranslationMap; diff --git a/GCC_XML/KWSys/SystemTools.hxx.in b/GCC_XML/KWSys/SystemTools.hxx.in index 94586b0..6fad217 100644 --- a/GCC_XML/KWSys/SystemTools.hxx.in +++ b/GCC_XML/KWSys/SystemTools.hxx.in @@ -754,6 +754,10 @@ public: static const char* GetEnv(const char* key); static bool GetEnv(const char* key, kwsys_stl::string& result); + /** Put a string into the environment + of the form var=value */ + static bool PutEnv(const char* value); + /** * Get current working directory CWD */ diff --git a/GCC_XML/KWSys/hashtable.hxx.in b/GCC_XML/KWSys/hashtable.hxx.in index 9714797..6751a23 100644 --- a/GCC_XML/KWSys/hashtable.hxx.in +++ b/GCC_XML/KWSys/hashtable.hxx.in @@ -36,6 +36,10 @@ * purpose. It is provided "as is" without express or implied warranty. * */ +#ifdef __BORLANDC__ +# pragma warn -8027 /* 'for' not inlined. */ +# pragma warn -8026 /* 'exception' not inlined. */ +#endif #ifndef @KWSYS_NAMESPACE@_hashtable_hxx #define @KWSYS_NAMESPACE@_hashtable_hxx @@ -212,9 +216,9 @@ inline PIn hash_allocate_type(PIn (*)(TSize), // Define the comparison operators in terms of a base type to avoid // needing templated versions. class hash_allocator_base {}; -bool operator==(const hash_allocator_base&, +inline bool operator==(const hash_allocator_base&, const hash_allocator_base&) throw() { return true; } -bool operator!=(const hash_allocator_base&, +inline bool operator!=(const hash_allocator_base&, const hash_allocator_base&) throw() { return false; } // Define the allocator template. diff --git a/GCC_XML/KWSys/kwsysDateStamp.cmake b/GCC_XML/KWSys/kwsysDateStamp.cmake index 453121e..9130a59 100644 --- a/GCC_XML/KWSys/kwsysDateStamp.cmake +++ b/GCC_XML/KWSys/kwsysDateStamp.cmake @@ -4,7 +4,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2009) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 05) +SET(KWSYS_DATE_STAMP_MONTH 06) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 22) +SET(KWSYS_DATE_STAMP_DAY 12) diff --git a/GCC_XML/KWSys/kwsysPrivate.h b/GCC_XML/KWSys/kwsysPrivate.h index e021170..90623e5 100644 --- a/GCC_XML/KWSys/kwsysPrivate.h +++ b/GCC_XML/KWSys/kwsysPrivate.h @@ -39,7 +39,5 @@ #define KWSYS_NAMESPACE_STRING1(x) #x #else -# ifndef __VMS /* Avoid strange false positive on VMS compiler. */ -# error "kwsysPrivate.h included multiple times." -# endif +# error "kwsysPrivate.h included multiple times." #endif diff --git a/GCC_XML/KWSys/testAutoPtr.cxx b/GCC_XML/KWSys/testAutoPtr.cxx index c6515d9..f355283 100644 --- a/GCC_XML/KWSys/testAutoPtr.cxx +++ b/GCC_XML/KWSys/testAutoPtr.cxx @@ -11,9 +11,12 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#ifdef __BORLANDC__ +# pragma warn -8027 /* 'for' not inlined. */ +# pragma warn -8026 /* exception not inlined. */ +#endif #include "kwsysPrivate.h" #include KWSYS_HEADER(auto_ptr.hxx) - // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 diff --git a/GCC_XML/Support/CMakeLists.txt b/GCC_XML/Support/CMakeLists.txt index 0608d71..40a87bc 100644 --- a/GCC_XML/Support/CMakeLists.txt +++ b/GCC_XML/Support/CMakeLists.txt @@ -4,12 +4,15 @@ INSTALL(FILES gccxml_identify_compiler.cc ${GCCXML_INSTALL_COMPONENT_RUNTIME_LIBRARY}) INSTALL( - DIRECTORY GCC Intel MIPSpro Sun + DIRECTORY GCC Intel MIPSpro Sun IBM DESTINATION ${GCCXML_INSTALL_ROOT}${GCCXML_DATA_DIR} ${GCCXML_INSTALL_COMPONENT_RUNTIME_LIBRARY} PATTERN "find_flags" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE + PATTERN "*.sh" + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ + OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE PATTERN "CVS" EXCLUDE PATTERN "CMakeLists.txt" EXCLUDE PATTERN ".#*" EXCLUDE diff --git a/GCC_XML/Support/IBM/8.0/adapt_headers.sh b/GCC_XML/Support/IBM/8.0/adapt_headers.sh new file mode 100755 index 0000000..6348b1a --- /dev/null +++ b/GCC_XML/Support/IBM/8.0/adapt_headers.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +cd `dirname $0` + +######################################### +# Patch C++ Compiler Includes +######################################### + +XLC_INCLUDES=`../find_flags "$@" | perl -ne '($a) = m|-I([/a-zA-Z0-9\._-]+)|o ; print "$a\n" if $a'` + +for f in $XLC_INCLUDES/* +do + b=`basename $f` + + sed \ + -e 's/\(extern[[:space:]]\{1,\}\)"builtin"/\1"C"/g' \ + -e 's/^\([[:space:]]\{1,\}\)??=/\1#/g' \ + -e 's/__IBMCPP__ < 400/!defined(__GCCXML__)/g' \ + -e 's/IBM VisualAge C++ v4 and later compilers/GCCXML/g' \ + -e '/#pragma[[:space:]]\{1,\}implementation/d' \ + $f > $b.tmp + + if ! cmp -s $f $b.tmp + then + echo "modifying $b" + mv $b.tmp $b + else + rm $b.tmp + fi + +done + +patch -s -i stdlib.h.patch +patch -s -i xstring.patch diff --git a/GCC_XML/Support/IBM/8.0/stdlib.h.patch b/GCC_XML/Support/IBM/8.0/stdlib.h.patch new file mode 100644 index 0000000..b4e1e16 --- /dev/null +++ b/GCC_XML/Support/IBM/8.0/stdlib.h.patch @@ -0,0 +1,27 @@ +*** stdlib.h.orig Mon Jun 8 17:46:16 2009 +--- stdlib.h Mon Jun 8 17:46:32 2009 +*************** +*** 33,43 **** + # endif + + # if defined (__MATH__) && defined (_ANSI_C_SOURCE) +! inline int abs (int ); + # if defined (__ABS_LONG__) + extern "C++" inline long abs (long ); + # endif +! inline long labs (long ); + # endif + # if defined (__MATH__) && defined(__XLC13__) && defined(_LONG_LONG) && defined(_ALL_SOURCE) + inline long long llabs(long long); +--- 33,43 ---- + # endif + + # if defined (__MATH__) && defined (_ANSI_C_SOURCE) +! extern "C" inline int abs (int ); + # if defined (__ABS_LONG__) + extern "C++" inline long abs (long ); + # endif +! extern "C" inline long labs (long ); + # endif + # if defined (__MATH__) && defined(__XLC13__) && defined(_LONG_LONG) && defined(_ALL_SOURCE) + inline long long llabs(long long); diff --git a/GCC_XML/Support/IBM/8.0/xstring.patch b/GCC_XML/Support/IBM/8.0/xstring.patch new file mode 100644 index 0000000..ed04837 --- /dev/null +++ b/GCC_XML/Support/IBM/8.0/xstring.patch @@ -0,0 +1,19 @@ +*** xstring.orig Mon Jun 8 17:48:44 2009 +--- xstring Mon Jun 8 17:48:56 2009 +*************** +*** 571,577 **** + template + const typename basic_string<_E, _Tr, _A>::size_type + basic_string<_E, _Tr, _A>::npos = +! (basic_string<_E, _Tr, _A>::size_type)(-1); + + template inline + void swap(basic_string<_E, _Tr, _A>& _X, +--- 571,577 ---- + template + const typename basic_string<_E, _Tr, _A>::size_type + basic_string<_E, _Tr, _A>::npos = +! (typename basic_string<_E, _Tr, _A>::size_type)(-1); + + template inline + void swap(basic_string<_E, _Tr, _A>& _X, diff --git a/GCC_XML/Support/IBM/README b/GCC_XML/Support/IBM/README new file mode 100644 index 0000000..606915d --- /dev/null +++ b/GCC_XML/Support/IBM/README @@ -0,0 +1,8 @@ +IBM xlC support contributed by Hady Zalek + +This is a small README file regarding gccxml support for AIX and IBM xlC. + +The IBM xlC headers are not suitable for GCC and need to be adapted. The modified files may not be redistributed freely. This forces you to perform the following operations: + .//adapt_headers.sh + +This will produce corrected header files in the corresponding directory. diff --git a/GCC_XML/Support/IBM/find_flags b/GCC_XML/Support/IBM/find_flags new file mode 100755 index 0000000..9890a48 --- /dev/null +++ b/GCC_XML/Support/IBM/find_flags @@ -0,0 +1,51 @@ +#!/bin/sh +#============================================================================= +# +# Program: GCC-XML +# Module: find_flags +# Language: C++ +# Date: $Date$ +# Version: $Revision$ +# +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even +# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the above copyright notices for more information. +# +#============================================================================= + +# Find the compiler executable name. +if test "x$1" = "x" ; then + if test "x${CXX}" = "x" ; then + CXX=xlC + fi +else + CXX="$1" + shift + CXXFLAGS="$@" +fi + +# Find the compiler version +CXX_VERSION=`${CXX} -qversion 2>&1 | perl -ne 'print m|\WV(\d+\.\d+)|o'` +[ -z "${CXX_VERSION}" ] && echo "Could not find compiler version" && exit 1 + +# Compute the script dir +SCRIPT_DIR=`dirname $0` +if test "x$SCRIPT_DIR" = "x" ; then SCRIPT_DIR="." ; fi +SCRIPT_DIR=`cd "$SCRIPT_DIR" ; pwd` + +# Compute the version-specific support dir +CXX_SUPPORT_DIR="$SCRIPT_DIR/$CXX_VERSION" + +# Use the version-specific find_flags if available +if [ -f "$CXX_SUPPORT_DIR/find_flags" ] +then + . "$CXX_SUPPORT_DIR/find_flags" +else + . "$SCRIPT_DIR/find_flags_common" +fi + +# Print out the options +echo $OPTIONS diff --git a/GCC_XML/Support/IBM/find_flags_common b/GCC_XML/Support/IBM/find_flags_common new file mode 100755 index 0000000..b00c785 --- /dev/null +++ b/GCC_XML/Support/IBM/find_flags_common @@ -0,0 +1,48 @@ +#!/bin/sh +#============================================================================= +# +# Program: GCC-XML +# Module: find_flags_common +# Language: C++ +# Date: $Date$ +# Version: $Revision$ +# +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even +# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the above copyright notices for more information. +# +#============================================================================= + +# Find the include path directory. +CXX_BIN_DIR=$(dirname $(which "${CXX}")) +CXX_INC_DIR=$(dirname $CXX_BIN_DIR)/include + +if [ ! -d "$CXX_INC_DIR" ] +then + echo "Could not find the xlC include directory in $CXX_INC_DIR" + exit 1 +fi + +GCCXML_PID="$$" +cat > "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" < +! + +# Find the macro definition options. +MACROS=`${CXX} ${CXXFLAGS} /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc -E -V 2>&1 | perl -ne 'print m|(\W-D[^\s]+\s+)|og'` +MACROS="${MACROS} -D_WCHAR_T -D__MATH__ -D__TOS_AIX__ -D__BUILD_RT__" + +# Find the include path options. +INCLUDES="-I${CXX_INC_DIR} -I/usr/include" + +# Use hacked headers +INCLUDES="-iwrapper\"$CXX_SUPPORT_DIR\" $INCLUDES" + +# Cleanup +rm -rf "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" + +# Format the options. +OPTIONS="$MACROS $INCLUDES $SPECIAL" diff --git a/GCC_XML/Support/Sun/5.8/adaptation.patch b/GCC_XML/Support/Sun/5.8/Cstd.patch similarity index 51% rename from GCC_XML/Support/Sun/5.8/adaptation.patch rename to GCC_XML/Support/Sun/5.8/Cstd.patch index d28fdc3..d794484 100644 --- a/GCC_XML/Support/Sun/5.8/adaptation.patch +++ b/GCC_XML/Support/Sun/5.8/Cstd.patch @@ -1,7 +1,39 @@ -Common subdirectories: ./iso and ../result/iso -diff -r -u ./istream ../result/istream ---- ./istream Fri Nov 16 16:40:47 2007 -+++ ../result/istream Fri Nov 16 15:22:16 2007 +diff -r -u old/algorithm new/algorithm +--- old/algorithm 2009-06-05 10:01:07.000000000 +0200 ++++ new/algorithm 2009-06-05 10:01:43.000000000 +0200 +@@ -880,6 +880,11 @@ + RandomAccessIterator last, Pointer buffer, + Distance buffer_size, T*, Compare comp); + ++#if !defined(__MINMAX_DEFINED) ++ template ++ inline const T& (min)(const T& a, const T& b); ++#endif ++ + template + inline void __stable_sort (RandomAccessIterator first, + RandomAccessIterator last, +diff -r -u old/istream new/istream +--- old/istream 2009-06-05 10:01:07.000000000 +0200 ++++ new/istream 2009-06-05 10:01:43.000000000 +0200 +@@ -67,7 +67,7 @@ + + _EXPLICIT basic_istream(basic_streambuf *sb); + +- _EXPLICIT basic_istream(EmptyCtor) : basic_ios(1) {} ++ _EXPLICIT basic_istream(ios_base::EmptyCtor) : basic_ios(1) {} + virtual ~basic_istream(); + + class sentry +@@ -307,7 +307,7 @@ + } + else + { +- ostream_type* ost = stream.tie(); ++ basic_ostream* ost = stream.tie(); + if (ost && ost->rdbuf() != sb) + ost->flush(); + @@ -419,9 +419,11 @@ const istream_iterator& x, const istream_iterator& y); @@ -15,37 +47,62 @@ diff -r -u ./istream ../result/istream #endif public: typedef charT char_type; -diff -r -u ./math.h ../result/math.h ---- ./math.h Fri Nov 16 17:25:29 2007 -+++ ../result/math.h Fri Nov 16 15:22:16 2007 -@@ -313,6 +313,11 @@ - #endif - /* END adopted by C99 */ +diff -r -u old/ostream new/ostream +--- old/ostream 2009-06-05 10:01:07.000000000 +0200 ++++ new/ostream 2009-06-05 10:01:43.000000000 +0200 +@@ -88,7 +88,7 @@ + typedef basic_ios ios_type; -+/* SMOSS 29/08/07 conflicts with stdlib_iso.h */ -+#ifdef __EXTENSIONS__ -+# undef __EXTENSIONS__ -+#endif //__EXTENSIONS__ -+/* END SMOSS 29/08/07 conflicts with stdlib_iso.h */ - #if defined(__EXTENSIONS__) || !defined(__cplusplus) - #include - #endif -@@ -319,6 +324,11 @@ - #endif /* defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE) */ - #endif /* defined(__EXTENSIONS__) || defined(_XOPEN_SOURCE) || ... */ + _EXPLICIT basic_ostream(basic_streambuf *sb); +- _EXPLICIT basic_ostream(EmptyCtor) : basic_ios(1) {} ++ _EXPLICIT basic_ostream(ios_base::EmptyCtor) : basic_ios(1) {} + virtual ~basic_ostream(); -+/* SMOSS 29/08/07 conflicts with stdlib_iso.h */ -+#ifdef __EXTENSIONS__ -+# define __EXTENSIONS__ -+#endif //__EXTENSIONS__ -+/* END SMOSS 29/08/07 conflicts with stdlib_iso.h */ - #if defined(__cplusplus) && defined(__GNUC__) - #undef exception - #endif -Common subdirectories: ./rw and ../result/rw -diff -r -u ./streambuf ../result/streambuf ---- ./streambuf Fri Nov 16 16:40:47 2007 -+++ ../result/streambuf Fri Nov 16 15:22:16 2007 + class sentry { +@@ -97,8 +97,7 @@ + sentry(basic_ostream& stream) + : __stream(stream) + { +- +- streambuf_type* sb = stream.rdbuf(); ++ basic_streambuf* sb = stream.rdbuf(); + if ( sb ) { + stream.rdbuf()->buffer_mutex_.acquire(); + } +diff -r -u old/rw/iterator new/rw/iterator +--- old/rw/iterator 2009-06-05 10:01:07.000000000 +0200 ++++ new/rw/iterator 2009-06-05 10:01:43.000000000 +0200 +@@ -426,10 +426,12 @@ + friend inline difference_type (std::operator-) (const self& x, const self& y); + friend inline self (std::operator+) (difference_type n, const self& x); + #else +- friend inline bool operator== <> (const self& x, const self& y); +- friend inline bool operator< <> (const self& x, const self& y); +- friend inline difference_type operator- <> (const self& x, const self& y); +- friend inline self operator+ <> (difference_type n, const self& x); ++/* SMOSS 29/08/07 removing 'inline' from friend declarations */ ++ friend /*inline*/ bool operator== <> (const self& x, const self& y); ++ friend /*inline*/ bool operator< <> (const self& x, const self& y); ++ friend /*inline*/ difference_type operator- <> (const self& x, const self& y); ++ friend /*inline*/ self operator+ <> (difference_type n, const self& x); ++/* END SMOSS 29/08/07 removing 'inline' from friend declarations */ + #endif + protected: + +@@ -581,7 +583,9 @@ + typedef Reference reference; + typedef Pointer pointer; + +- friend inline bool operator== <> (const self& x, const self& y); ++/* SMOSS 29/08/07 removing 'inline' from friend declarations */ ++ friend /*inline*/ bool operator== <> (const self& x, const self& y); ++/* END SMOSS 29/08/07 removing 'inline' from friend declarations */ + + protected: + +diff -r -u old/streambuf new/streambuf +--- old/streambuf 2009-06-05 10:01:07.000000000 +0200 ++++ new/streambuf 2009-06-05 10:01:43.000000000 +0200 @@ -927,7 +927,10 @@ * int_type snextc() * returns the next character @@ -70,9 +127,9 @@ diff -r -u ./streambuf ../result/streambuf /* * basic_streambuf *pubsetbuf(char_type *, streamsize) -diff -r -u ./string ../result/string ---- ./string Fri Nov 16 16:40:47 2007 -+++ ../result/string Fri Nov 16 15:22:16 2007 +diff -r -u old/string new/string +--- old/string 2009-06-05 10:01:07.000000000 +0200 ++++ new/string 2009-06-05 10:01:43.000000000 +0200 @@ -797,7 +797,9 @@ // Null string ref // @@ -84,10 +141,9 @@ diff -r -u ./string ../result/string #endif static __string_ref_type * __getNullRep () -Common subdirectories: ./sys and ../result/sys -diff -r -u ./typeinfo ../result/typeinfo ---- ./typeinfo Fri Nov 16 16:40:47 2007 -+++ ../result/typeinfo Fri Nov 16 15:22:16 2007 +diff -r -u old/typeinfo new/typeinfo +--- old/typeinfo 2009-06-05 10:01:07.000000000 +0200 ++++ new/typeinfo 2009-06-05 10:01:43.000000000 +0200 @@ -34,7 +34,8 @@ // Implementation const void* __data; @@ -98,71 +154,3 @@ diff -r -u ./typeinfo ../result/typeinfo }; class bad_typeid: public exception { -diff -r -u ./iso/stdlib_iso.h ../result/iso/stdlib_iso.h ---- ./iso/stdlib_iso.h Fri Nov 16 16:40:47 2007 -+++ ../result/iso/stdlib_iso.h Fri Nov 16 15:22:16 2007 -@@ -110,8 +110,10 @@ - extern double atof(const char *); - extern int atoi(const char *); - extern long int atol(const char *); -+/* SMOSS 29/08/07 - extern void *bsearch(const void *, const void *, size_t, size_t, - int (*)(const void *, const void *)); -+*/ - #if __cplusplus >= 199711L - extern "C++" { - void *bsearch(const void *, const void *, size_t, size_t, -@@ -131,7 +133,6 @@ - extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, - size_t); - extern int mbtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t); --extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); - #if __cplusplus >= 199711L - extern "C++" { - void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); -diff -r -u ./rw/iterator ../result/rw/iterator ---- ./rw/iterator Fri Nov 16 17:03:59 2007 -+++ ../result/rw/iterator Fri Nov 16 15:22:16 2007 -@@ -426,10 +426,12 @@ - friend inline difference_type (std::operator-) (const self& x, const self& y); - friend inline self (std::operator+) (difference_type n, const self& x); - #else -- friend inline bool operator== <> (const self& x, const self& y); -- friend inline bool operator< <> (const self& x, const self& y); -- friend inline difference_type operator- <> (const self& x, const self& y); -- friend inline self operator+ <> (difference_type n, const self& x); -+/* SMOSS 29/08/07 removing 'inline' from friend declarations */ -+ friend /*inline*/ bool operator== <> (const self& x, const self& y); -+ friend /*inline*/ bool operator< <> (const self& x, const self& y); -+ friend /*inline*/ difference_type operator- <> (const self& x, const self& y); -+ friend /*inline*/ self operator+ <> (difference_type n, const self& x); -+/* END SMOSS 29/08/07 removing 'inline' from friend declarations */ - #endif - protected: - -@@ -581,7 +583,9 @@ - typedef Reference reference; - typedef Pointer pointer; - -- friend inline bool operator== <> (const self& x, const self& y); -+/* SMOSS 29/08/07 removing 'inline' from friend declarations */ -+ friend /*inline*/ bool operator== <> (const self& x, const self& y); -+/* END SMOSS 29/08/07 removing 'inline' from friend declarations */ - - protected: - -diff -r -u ./sys/regset.h ../result/sys/regset.h ---- ./sys/regset.h Fri Nov 16 16:40:47 2007 -+++ ../result/sys/regset.h Fri Nov 16 15:22:16 2007 -@@ -16,7 +16,10 @@ - #pragma ident "@(#)regset.h 1.28 04/09/28 SMI" /* SVr4.0 1.1 */ - - #include -- -+/* SMOSS 29/08/07 */ -+//#include -+typedef long long unsigned int uint64_t; -+/* end SMOSS 29/08/08 */ - #if !defined(_ASM) - #include - #endif diff --git a/GCC_XML/Support/Sun/5.8/adapt_headers.sh b/GCC_XML/Support/Sun/5.8/adapt_headers.sh new file mode 100755 index 0000000..0a4d3af --- /dev/null +++ b/GCC_XML/Support/Sun/5.8/adapt_headers.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +cd `dirname $0` + +######################################### +# Patch STL Headers (Non-STLport) +######################################### + +CC_INCLUDES=`../find_flags "$@" | perl -ne '($a) = m|-I([/a-zA-Z0-9\._-]+/include/CC)|o ; print "$a\n" if $a'` + +mkdir -p rw + +cp $CC_INCLUDES/typeinfo . +cp $CC_INCLUDES/Cstd/istream . +cp $CC_INCLUDES/Cstd/ostream . +cp $CC_INCLUDES/Cstd/streambuf . +cp $CC_INCLUDES/Cstd/string . +cp $CC_INCLUDES/Cstd/algorithm . +cp $CC_INCLUDES/Cstd/rw/iterator rw/iterator + +gpatch -p1 < Cstd.patch + +######################################### +# Patch the standard headers +######################################### + +if [ `uname -r` = "5.10" ] +then + mkdir -p iso + cp /usr/include/iso/stdlib_iso.h iso + gpatch -p1 < std-5.10.patch +fi diff --git a/GCC_XML/Support/Sun/5.8/std-5.10.patch b/GCC_XML/Support/Sun/5.8/std-5.10.patch new file mode 100644 index 0000000..5e81e4a --- /dev/null +++ b/GCC_XML/Support/Sun/5.8/std-5.10.patch @@ -0,0 +1,22 @@ +diff -r -u old/iso/stdlib_iso.h new/iso/stdlib_iso.h +--- old/iso/stdlib_iso.h Wed May 20 12:02:31 2009 ++++ new/iso/stdlib_iso.h Wed May 20 12:01:23 2009 +@@ -110,8 +110,10 @@ + extern double atof(const char *); + extern int atoi(const char *); + extern long int atol(const char *); ++/* SMOSS 29/08/07 + extern void *bsearch(const void *, const void *, size_t, size_t, + int (*)(const void *, const void *)); ++*/ + #if __cplusplus >= 199711L + extern "C++" { + void *bsearch(const void *, const void *, size_t, size_t, +@@ -131,7 +133,6 @@ + extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, + size_t); + extern int mbtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t); +-extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); + #if __cplusplus >= 199711L + extern "C++" { + void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); diff --git a/GCC_XML/Support/Sun/README b/GCC_XML/Support/Sun/README index 4fda313..29f88a2 100644 --- a/GCC_XML/Support/Sun/README +++ b/GCC_XML/Support/Sun/README @@ -1,8 +1,8 @@ Sun CC support contributed by Pierre-Olivier Gaillard -This is a small README file regarding gccxml support for Solaris and Sun CC 5.8. +This is a small README file regarding gccxml support for Solaris and Sun CC. -The Sun CC headers are not suitable for GCC and need to be adapted. The adapted files may not be redistributed freely. This forces you to perform the following operations: - ./adapt_headers.sh +The Sun CC headers are not suitable for GCC and need to be adapted. The modified files may not be redistributed freely. This forces you to perform the following operations: + .//adapt_headers.sh -This will produce corrected header files in the 5.8 directory. +This will produce corrected header files in the corresponding directory. diff --git a/GCC_XML/Support/Sun/adapt_headers.sh b/GCC_XML/Support/Sun/adapt_headers.sh deleted file mode 100755 index eb6919d..0000000 --- a/GCC_XML/Support/Sun/adapt_headers.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -INCLUDES=/usr/include -CC_INCLUDES=`find_flags | perl -ne '($a) = m|-I([/a-zA-Z0-9_-]+/include/CC)|o ; print "$a\n" if $a'` - -cd 5.8 - -cp $INCLUDES/math.h . -cp $CC_INCLUDES/typeinfo . -cp $CC_INCLUDES/Cstd/istream . -cp $CC_INCLUDES/Cstd/streambuf . -cp $CC_INCLUDES/Cstd/string . - -mkdir -p rw -mkdir -p sys -mkdir -p iso - -cp $CC_INCLUDES/Cstd/rw/iterator rw/iterator -cp $INCLUDES/iso/stdio_iso.h iso -cp $INCLUDES/iso/stdlib_iso.h iso - -cp $INCLUDES/sys/regset.h sys - -patch -p1 < adaptation.patch diff --git a/GCC_XML/Support/Sun/find_flags b/GCC_XML/Support/Sun/find_flags index ff8ae32..9e5e339 100755 --- a/GCC_XML/Support/Sun/find_flags +++ b/GCC_XML/Support/Sun/find_flags @@ -15,7 +15,8 @@ # PURPOSE. See the above copyright notices for more information. # #============================================================================= -# Find the CC executable name. + +# Find the compiler executable name. if test "x$1" = "x" ; then if test "x${CXX}" = "x" ; then CXX=CC @@ -26,44 +27,25 @@ else CXXFLAGS="$@" fi -GCCXML_PID="$$" -cat > "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" < -! - -# Find the macro definition options. -MACROS=`${CXX} /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc -E -xdumpmacros=defs 2>&1 | - awk '{ if ($1 ~ /#define/) printf("-D%s=%s %s %s ",$2,$3,$4,$5) }' - ` -MACROS="-D__cplusplus=199711L -D__STDC__ -D_REENTRANT $MACROS" - -# Find the include path options. -#todo test for truss -INCLUDES=`truss -f -t openat ${CXX} -E /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc 2>&1 | - awk '{if ($3 ~ /\"[A-Za-z0-9_\/.-]+\",/ && $3 !~ /tmp/) - if (tempString!=substr($3,2,length($3)-3)) - { - tempString=substr($3,2,length($3)-3); - printf("-I%s ",tempString) - } - }'` - -#cleanup -rm -rf "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" +# Find the compiler version +CXX_VERSION=`${CXX} -V 2>&1 | awk '{print $4}'` +[ -z "${CXX_VERSION}" ] && echo "Could not find compiler version" && exit 1 -# The support headers are located where this script is. -SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'` -if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi -SELFPATH=`cd "$SELFPATH" ; pwd` +# Compute the script dir +SCRIPT_DIR=`dirname $0` +if test "x$SCRIPT_DIR" = "x" ; then SCRIPT_DIR="." ; fi +SCRIPT_DIR=`cd "$SCRIPT_DIR" ; pwd` -# Find CC version -CC_VERSION=`${CXX} -V 2>&1 | awk '{print $4}'` +# Compute the version-specific support dir +CXX_SUPPORT_DIR="$SCRIPT_DIR/$CXX_VERSION" -# Use hacked headers for CC 5.8 -if [ $CC_VERSION = 5.8 ]; then - INCLUDES="-iwrapper\"$SELFPATH/5.8\" $INCLUDES" +# Use the version-specific find_flags if available +if [ -f "$CXX_SUPPORT_DIR/find_flags" ] +then + . "$CXX_SUPPORT_DIR/find_flags" +else + . "$SCRIPT_DIR/find_flags_common" fi -# Format and print out the options. -OPTIONS="$MACROS $INCLUDES $SPECIAL" +# Print out the options echo $OPTIONS diff --git a/GCC_XML/Support/Sun/find_flags_common b/GCC_XML/Support/Sun/find_flags_common new file mode 100755 index 0000000..488e6e8 --- /dev/null +++ b/GCC_XML/Support/Sun/find_flags_common @@ -0,0 +1,42 @@ +#!/bin/sh +#============================================================================= +# +# Program: GCC-XML +# Module: find_flags_common +# Language: C++ +# Date: $Date$ +# Version: $Revision$ +# +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even +# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the above copyright notices for more information. +# +#============================================================================= + +GCCXML_PID="$$" +cat > "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" < +! + +# Find the macro definition options. +MACROS=`${CXX} ${CXXFLAGS} /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc -E -xdumpmacros=defs 2>&1 | + awk '{ if ($1 ~ /#define/) printf("-D%s=%s %s %s ",$2,$3,$4,$5) }'` +MACROS="-D__cplusplus=199711L -D__STDC__ -D_REENTRANT $MACROS" + +# Find the include path options. +INCLUDES="`echo '' | ${CXX} -v -E ${CXXFLAGS} ~ 2>&1 | perl -ne 'print m|(-I/[/a-zA-Z0-9\._-]+\s*)|og'`" +INCLUDES="$INCLUDES -I/usr/include" + +# Use hacked headers +if [ -d "$CXX_SUPPORT_DIR" ]; then + INCLUDES="-iwrapper\"$CXX_SUPPORT_DIR\" $INCLUDES" +fi + +# Cleanup +rm -rf "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" + +# Format the options. +OPTIONS="$MACROS $INCLUDES $SPECIAL" diff --git a/GCC_XML/Support/gccxml_identify_compiler.cc b/GCC_XML/Support/gccxml_identify_compiler.cc index c51cc42..56aecec 100644 --- a/GCC_XML/Support/gccxml_identify_compiler.cc +++ b/GCC_XML/Support/gccxml_identify_compiler.cc @@ -6,6 +6,8 @@ GCCXML_SUPPORT="MIPSpro" GCCXML_SUPPORT="Intel" #elif defined(__SUNPRO_CC) GCCXML_SUPPORT="Sun" +#elif defined(__IBMCPP__) +GCCXML_SUPPORT="IBM" #else GCCXML_SUPPORT="" #endif diff --git a/GCC_XML/VcInstall/gccxml_vcupdate.bat.in b/GCC_XML/VcInstall/gccxml_vcupdate.bat.in index a3b0b56..a605262 100755 --- a/GCC_XML/VcInstall/gccxml_vcupdate.bat.in +++ b/GCC_XML/VcInstall/gccxml_vcupdate.bat.in @@ -4,10 +4,21 @@ rem This is a driver script to update GCC-XML's support of new Visual Studio rem installations. rem -------------------------------------------------------------------------- -rem Reference this script - strip double quotes if Windows_NT set vcupdate=%0 -if "%OS%" equ "Windows_NT" set vcupdate=%~0 +if "%OS%" equ "Windows_NT" (goto winnt) else (goto non_winnt) +:winnt +rem Get absolute name of directory where this batch is +rem and strip double quotes +set vcupdate=%~dp0 + +rem Get the absolute name of the VC data directory +set directory="%vcupdate%\..\@VC_DATA_DIR@" +for %%T in (%directory%) do set vc_dir=%%~dfT + +goto start + +:non_winnt rem Reference the TEMP directory in a safe way. set vc_temp=%TEMP%. @@ -26,10 +37,16 @@ call "%vc_temp%\vc_env_temp.bat" del "%vc_temp%\vc_env_temp.bat" set vc_dir=%vc_result% +set vcupdate=%vcupdate%\.. + rem Change back to the original working directory. cd /D "%cwd%" +goto start + +:start + rem Run the installer executable to do the rest of the work. -"%vcupdate%\..\gccxml_vcconfig" "%vc_dir%\VcInstall" "%vc_dir%" +"%vcupdate%\gccxml_vcconfig.exe" "%vc_dir%\VcInstall" "%vc_dir%" if errorlevel 1 pause