lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5123] Upgrade Comeau compiler from 4.3.3 (20040505) to 4.


From: Greg Chicares
Subject: [lmi-commits] [5123] Upgrade Comeau compiler from 4.3.3 (20040505) to 4.3.10.1 (current)
Date: Mon, 13 Dec 2010 20:21:00 +0000

Revision: 5123
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5123
Author:   chicares
Date:     2010-12-13 20:20:59 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
Upgrade Comeau compiler from 4.3.3 (20040505) to 4.3.10.1 (current)

Modified Paths:
--------------
    lmi/trunk/ChangeLog

Added Paths:
-----------
    lmi/trunk/como.make
    lmi/trunk/install_como.sh

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-12-04 16:19:48 UTC (rev 5122)
+++ lmi/trunk/ChangeLog 2010-12-13 20:20:59 UTC (rev 5123)
@@ -26900,3 +26900,11 @@
   workhorse.make
 Handle missing testdecks more gracefully.
 
+20101213T2020Z <address@hidden> [656]
+
+  como_4_3_3.make [renamed to 'como.make']
+  install_como.sh [new file]
+  test_coding_rules.cpp
+Upgrade Comeau compiler from 4.3.3 (20040505) to 4.3.10.1 (current).
+The older version couldn't handle the SFINAE code in 'contains.hpp'.
+

Copied: lmi/trunk/como.make (from rev 5122, lmi/trunk/como_4_3_3.make)
===================================================================
--- lmi/trunk/como.make                         (rev 0)
+++ lmi/trunk/como.make 2010-12-13 20:20:59 UTC (rev 5123)
@@ -0,0 +1,253 @@
+# Limited support for Comeau C++ 4.3.x under msw only.
+
+# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Gregory W. Chicares.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+#
+# http://savannah.nongnu.org/projects/lmi
+# email: <address@hidden>
+# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+# $Id$
+
+# Limited support for Comeau C++ version 4.3.10.1, using MinGW gcc as
+# the underlying C compiler, with a Cygwin shell. Comeau C++ is useful
+# because it conforms to the standard in some ways that gcc does not,
+# so it may reveal defects not found with gcc alone.
+
+# SOMEDAY !! Errors may arise from template-instantiation conflicts,
+# e.g., when many targets are built in the same directory. Ideas:
+#  - use '-T'
+#  - routinely delete '.ii' files
+#  - use a monolithic library for all code shared by unit tests
+#  - use a distinct subdirectory for each target
+# Cf.:
+# http://www-d0.fnal.gov/KAI/doc/UserGuide/faq.html#multiple_template_instance
+
+toolset      := como
+
+src_dir      := $(CURDIR)
+
+gcc_version  :=
+
+prefix       := /opt/lmi
+exec_prefix  := $(prefix)
+lmi_bin_dir  := $(exec_prefix)/bin
+
+como_dir     := $(prefix)/como
+como_bin_dir := $(como_dir)/bin
+
+# Comeau C++ requires an underlying C compiler--here, a particular
+# version of MinGW gcc-2.95.3-5, as discussed in 'install_como.sh'.
+
+mingw_gcc2   := mingw_for_como
+
+gcc2_dir     := $(como_dir)/$(mingw_gcc2)
+gcc2_bin_dir := $(gcc2_dir)/bin
+
+# Comeau C++ for msw requires $COMO_MIN_INCLUDE to specify the
+# underlying C compiler's include directory.
+
+gcc2_inc_dir := $(gcc2_dir)/include
+
+# Use gcc-3.x for autodependencies and physical-closure testing.
+
+# SOMEDAY !! Ideally, the preprocessor used for autodependencies would
+# impersonate Comeau C++. The "UNUSED_" variable below is probably not
+# complete, and special include paths probably would need to be set.
+# This is not easy because the Comeau preprocessor is not free and has
+# no option like GNU cpp's '-dM' to list the macros it predefines. Yet
+# it is not very important either, because Comeau C++ isn't remarkably
+# different from gcc wrt conformance, so there are few conditionals to
+# differentiate them and gcc dependencies work well enough for now.
+
+UNUSED_compiler_impersonation_cppflags := \
+  -undef -nostdinc \
+  -U __GNUC__ -U __GNUG__ -U __GNUC_MINOR__ -U __GNUC_PATCHLEVEL__ \
+  -D LMI_IGNORE_PCH \
+  -D __COMO__ \
+
+gcc3_dir     := /MinGW_
+gcc3_bin_dir := $(gcc3_dir)/bin
+
+# Comeau C++ for msw requires both its own bin/ directory and the
+# underlying C compiler's bin/ directory to be on the path. They must
+# precede Cygwin's system directories because Cygwin puts its own gcc
+# in /usr/bin/ . Comeau C++ suggests a MinGW gcc-2.95.3 tarball that
+# unfortunately comes bundled with its own obsolete 'make', which must
+# be removed or renamed to keep it from clashing with Cygwin's 'make'
+# (though this doesn't matter if 'install_como.sh' is used).
+
+insidious_make := $(gcc2_bin_dir)/make.exe
+
+ifneq (,$(wildcard $(insidious_make)))
+  $(error Remove or rename '$(insidious_make)')
+endif
+
+# Comeau C++ does not automatically define the customary macros for
+# identifying the msw-intel platform.
+
+CPPFLAGS := \
+  -D__WIN32__ \
+  -D_X86_ \
+
+CC                 := gcc
+# Overridden below, but only after use for $(LD):
+CXX                := como
+
+C_WARNINGS         :=
+CXX_WARNINGS       :=
+
+C_EXTRA_WARNINGS   :=
+CXX_EXTRA_WARNINGS :=
+
+# Comeau C++'s '--strict' option is incompatible with MinGW system
+# headers, and even its relaxed '--a' counterpart is incompatible with
+# '__declspec'.
+#
+# '--display_error_number' shows numeric error codes that may be
+# useful for choosing diagnostics to suppress for code that is not
+# 'strictly conforming'.
+#
+# Diagnostic 161: unrecognized pragma: occurs frequently in wx.
+#
+# Diagnostic 654: supposed 'declspec' incompatibility: there seems to
+# be no way to avoid such a warning here:
+#   [declspec] void* operator new  (std::size_t, wx_allocator);
+#   void* operator new(std::size_t bytes, wx_allocator) {...}
+# Como requires that the decoration precede the return type in the
+# declaration, but doesn't allow it anywhere in the definition. With
+# '--a', this doesn't need to be suppressed, but neither does it hurt
+# because '--a' treats any '__declspec' as an error.
+#
+# Diagnostics 1195 and 1200: emulated ms defective loop variable
+# scoping.
+
+nonstrict_cxxflags := \
+  --diag_suppress=161 \
+  --diag_suppress=654 \
+  --diag_suppress=1195 \
+  --diag_suppress=1200 \
+  --display_error_number \
+  --long_long \
+  --no_microsoft_bugs \
+
+strict_cxxflags := \
+  --a \
+  --display_error_number \
+  --long_long \
+  --no_microsoft_bugs \
+
+# Comeau C++'s strict mode is incompatible with many useful libraries
+# such as boost::filesystem (if built from source).
+
+# To get rid of the ms nonsense and use the strictest mode available
+# on msw, uncomment the next two lines.
+# CPPFLAGS :=
+# CXXFLAGS := --a
+
+CXXFLAGS := $(nonstrict_cxxflags) --no_prelink_verbose
+
+# For debugging on msw with gcc as the underlying C compiler, add
+#  /g
+# to $(CXXFLAGS): the slash is required, and '-g' doesn't work.
+# SOMEDAY !! Test this; modify the CXX wrapper to handle it as a
+# special case if necessary.
+
+LD := $(CXX)
+
+LDFLAGS :=
+
+# Library order is crucial.
+#
+# Comeau C++ doesn't accept '-lxslt.dll -lxml2.dll', so required
+# libraries are specified here as full filepaths. It treats leading
+# slashes as option delimiters, so leading slashes in library names
+# are changed here to doubled backslashes. SOMEDAY !! A 'como_ld'
+# program could accept gcc syntax.
+
+REQUIRED_LIBS := \
+  \\opt/lmi/local/lib/libexslt.dll.a \
+  \\opt/lmi/local/lib/libxslt.dll.a \
+  \\opt/lmi/local/lib/libxml2.dll.a \
+
+# SOMEDAY !! Use mpatrol.
+MPATROL_LIBS :=
+
+excluded_unit_test_targets := \
+  regex_test \
+  round_test \
+
+GNU_CPP := $(gcc3_bin_dir)/cpp
+GNU_CXX := $(gcc3_bin_dir)/g++
+
+MAKEDEPEND_FLAGS   :=
+MAKEDEPEND_COMMAND := MAKEDEPEND_NON_GCC_COMMAND
+
+MAKECMDGOALS ?= lmi_cli_monolithic.exe
+
+# Default target.
+$(MAKECMDGOALS):
+
+como_4_3_3.make:: ;
+
+# SOMEDAY !! Comeau C++ should have its own wrapper. For now, the
+# borland wrapper works.
+
+CXX := \
+  $(lmi_bin_dir)/bcc_cc \
+  --accept --program como \
+
+# Comeau C++ for msw requires both its own bin/ directory and the
+# underlying C compiler's bin/ directory to be on the path, and an
+# msw path to the underlying C compiler's include directory to be
+# given in another environment variable. Specify environment changes
+# explicitly here, before invoking $(MAKE).
+#
+# Use '--jobs=1' to prevent 'make' parallelism, which appears to be
+# incompatible with Comeau C++. Ignore any "disabling jobserver mode"
+# warning that this engenders.
+
+%: force
+       @export PATH=$(como_bin_dir):$(gcc2_bin_dir):$$PATH; \
+       export COMO_MIN_INCLUDE=$(gcc2_inc_dir); \
+       $(MAKE) \
+         --file=$(src_dir)/GNUmakefile \
+         --jobs=1 \
+                               gcc_version='$(gcc_version)' \
+                                   src_dir='$(src_dir)' \
+                                   toolset='$(toolset)' \
+                                C_WARNINGS='$(C_WARNINGS)' \
+                              CXX_WARNINGS='$(CXX_WARNINGS)' \
+                          C_EXTRA_WARNINGS='$(C_EXTRA_WARNINGS)' \
+                        CXX_EXTRA_WARNINGS='$(CXX_EXTRA_WARNINGS)' \
+                                  CPPFLAGS='$(CPPFLAGS)' \
+           
compiler_impersonation_cppflags='$(compiler_impersonation_cppflags)' \
+                                        CC='$(CC)' \
+                                       CXX='$(CXX)' \
+                                  CXXFLAGS='$(CXXFLAGS)' \
+                                        LD='$(LD)' \
+                                   LDFLAGS='$(LDFLAGS)' \
+                             REQUIRED_LIBS='$(REQUIRED_LIBS)' \
+                              MPATROL_LIBS='$(MPATROL_LIBS)' \
+                          platform_defines='' \
+                excluded_unit_test_targets='$(excluded_unit_test_targets)' \
+                                   GNU_CPP='$(GNU_CPP)' \
+                                   GNU_CXX='$(GNU_CXX)' \
+                          MAKEDEPEND_FLAGS='$(MAKEDEPEND_FLAGS)' \
+                        MAKEDEPEND_COMMAND='$(MAKEDEPEND_COMMAND)' \
+         $(MAKECMDGOALS); \
+
+force: ;
+

Added: lmi/trunk/install_como.sh
===================================================================
--- lmi/trunk/install_como.sh                           (rev 0)
+++ lmi/trunk/install_como.sh   2010-12-13 20:20:59 UTC (rev 5123)
@@ -0,0 +1,243 @@
+#!/bin/sh
+
+# Install como C++ on msw, with MinGW gcc-2.95.3-5 as its C compiler.
+
+# Copyright (C) 2010 Gregory W. Chicares.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+#
+# http://savannah.nongnu.org/projects/lmi
+# email: <address@hidden>
+# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+# $Id$
+
+set -v
+
+  # Prerequisites: a normal lmi installation, with 'unzip' and 'cpio'
+  # added to the usual Cygwin packages; and the Comeau compiler.
+
+cache_dir=/cache_for_lmi/downloads
+
+mkdir --parents /opt/lmi/como
+cd /opt/lmi/como
+
+  # Archive name is personalized by vendor. A copy of it is assumed
+  # to have been saved in $cache_dir .
+
+cp --preserve $cache_dir/200043101* .
+unzip -u 200043101beta*
+
+  # According to this page:
+  #   http://comeaucomputing.com/4.3.0/minor/win95+/como43101.html
+  # configuration is simpler when "libcomo is installed into the
+  # Comeau C++ directory tree in a directory named libcomo".
+  #
+  # As with redhat, don't use the '-c' flag for 'cpio' with Cygwin;
+  # see:
+  #   http://www.comeaucomputing.com/libcomo/36.html
+
+como_server=ftp://ftp.comeaucomputing.com/pub/
+libcomo_archive=libcomo36.Z
+cd $cache_dir && [ -e $libcomo_archive ] || wget --timestamping 
$como_server/$libcomo_archive
+
+mkdir --parents /opt/lmi/como/libcomo
+cd /opt/lmi/como/libcomo
+
+cp --preserve $cache_dir/$libcomo_archive .
+uncompress --force $libcomo_archive
+cpio -ivdIlibcomo36
+rm libcomo36
+
+  # Use MinGW gcc-2.95.3-5 as the underlying C compiler. This page:
+  #   http://comeaucomputing.com/4.3.0/minor/win95+/como43101.html
+  # says a suitable gcc is available here:
+  #   http://prdownloads.sourceforge.net/mingw/mingw-1.0.1-20010726.tar.gz
+  # However, sourceforge has been redisorganized, and that file has
+  # been either hidden or removed. The closest thing available on
+  # sourceforge is only slightly different:
+  #   
http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/GCC/Version2/Current%20Release_%20gcc-2.95.3/
+  # The original tarball is still available here:
+  #   http://www2.cs.uidaho.edu/~jeffery/%77in32/mingw-1.0.1-20010726.tar.gz
+  # and its md5sum:
+  #   99b3cf9fb4a1b82654a4caf11ef1a429 *mingw-1.0.1-20010726.tar.gz
+  # matches that of another copy that I downloaded from sourceforge
+  # in 2004, so it's authentic. However, it's even better to use lmi's
+  # own MinGW installer, which was validated against that tarball.
+  #
+  # It ought to be possible to use MinGW-3.4.5 instead with a few
+  # changes to this script, viz.:
+  #   make ... version=MinGW-20010726
+  #   touch /opt/lmi/como/default.min345
+  #   cd /opt/lmi/como/libcomo && ./makeit.bat min345
+  # but 'invalid option: --min345' is unexpectedly observed.
+
+cd /opt/lmi/como
+make \
+       prefix=/opt/lmi/como/mingw_for_como \
+    cache_dir=/cache_for_lmi/downloads \
+      version=MinGW-20010726 \
+  -f /lmi/src/lmi/install_mingw.make
+
+  # Create patch for shadow headers. See:
+  #   http://comeaucomputing.com/4.3.0/minor/win95+/como43101.html
+
+cat >MinGW-20010726.patch <<\EOF
+diff -U3 older/float.h newer/float.h
+--- older/float.h      2001-07-26 01:51:11.000000000 +0000
++++ newer/float.h      2010-12-11 01:05:05.868059600 +0000
+@@ -82,7 +82,7 @@
+  * The characteristics of double.
+  */
+ #define DBL_DIG               15
+-#define DBL_EPSILON   1.1102230246251568e-16
++#define DBL_EPSILON   2.2204460492503131e-16
+ #define DBL_MANT_DIG  53
+ #define DBL_MAX               1.7976931348623157e+308
+ #define DBL_MAX_EXP   1024
+@@ -97,7 +97,7 @@
+  * NOTE: long double is the same as double.
+  */
+ #define LDBL_DIG      15
+-#define LDBL_EPSILON  1.1102230246251568e-16L
++#define LDBL_EPSILON  1.08420217248550443401e-19L
+ #define LDBL_MANT_DIG 53
+ #define LDBL_MAX      1.7976931348623157e+308L
+ #define LDBL_MAX_EXP  1024
+diff -U3 older/rpcdcep.h newer/rpcdcep.h
+--- older/rpcdcep.h    2001-07-26 01:46:06.000000000 +0000
++++ newer/rpcdcep.h    2010-12-11 01:05:05.914936700 +0000
+@@ -81,7 +81,7 @@
+ void __stdcall I_RpcRequestMutex(I_RPC_MUTEX*);
+ void __stdcall I_RpcClearMutex(I_RPC_MUTEX);
+ void __stdcall I_RpcDeleteMutex(I_RPC_MUTEX);
+-__stdcall void *I_RpcAllocate(unsigned int);
++void __stdcall *I_RpcAllocate(unsigned int);
+ void __stdcall I_RpcFree(void*);
+ void __stdcall I_RpcPauseExecution(unsigned long);
+ typedef void(__stdcall *PRPC_RUNDOWN) (void*);
+diff -U3 older/winnt.h newer/winnt.h
+--- older/winnt.h      2001-07-26 01:46:12.000000000 +0000
++++ newer/winnt.h      2010-12-11 01:05:05.946188100 +0000
+@@ -2509,24 +2509,15 @@
+ } REPARSE_POINT_INFORMATION, *PREPARSE_POINT_INFORMATION;
+ extern __inline PVOID GetCurrentFiber(void)
+ {
+-    void* ret;
+-    __asm__ volatile ("\n\
+-            movl      %%fs:0x10,%0\n\
+-            movl      (%0),%0\n\
+-            " : "=r" (ret) /* allow use of reg eax, ebx, ecx, edx, esi, edi */
+-              :
+-            );
+-    return ret;
++    __asm mov eax, fs:[0x10]
++    return 0;
+ }
+ extern __inline PVOID GetFiberData(void)
+ {
+-    void* ret;
+-    __asm__ volatile ("\n\
+-            movl      %%fs:0x10,%0\n\
+-            " : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
+-              :
+-              );
+-    return ret;
++    __asm { mov eax, fs:[0x10]
++            mov eax,[eax]
++          }
++    return 0;
+ }
+ #endif
+ #ifdef __cplusplus
+diff -U3 older/winsock.h newer/winsock.h
+--- older/winsock.h    2001-07-26 01:46:13.000000000 +0000
++++ newer/winsock.h    2010-12-11 01:05:05.946188100 +0000
+@@ -429,7 +429,7 @@
+ int PASCAL getsockname(SOCKET,struct sockaddr*,int*);
+ int PASCAL getsockopt(SOCKET,int,int,char*,int*);
+ unsigned long PASCAL inet_addr(const char*);
+-PASCAL char *inet_ntoa(struct in_addr);
++char * PASCAL inet_ntoa(struct in_addr);
+ int PASCAL listen(SOCKET,int);
+ int PASCAL recv(SOCKET,char*,int,int);
+ int PASCAL recvfrom(SOCKET,char*,int,int,struct sockaddr*,int*);
+@@ -438,12 +438,12 @@
+ int PASCAL setsockopt(SOCKET,int,int,const char*,int);
+ int PASCAL shutdown(SOCKET,int);
+ SOCKET PASCAL socket(int,int,int);
+-PASCAL struct hostent *gethostbyaddr(const char*,int,int);
+-PASCAL struct hostent *gethostbyname(const char*);
+-PASCAL struct servent *getservbyport(int,const char*);
+-PASCAL struct servent *getservbyname(const char*,const char*);
+-PASCAL struct protoent *getprotobynumber(int);
+-PASCAL struct protoent *getprotobyname(const char*);
++struct hostent * PASCAL gethostbyaddr(const char*,int,int);
++struct hostent * PASCAL gethostbyname(const char*);
++struct servent * PASCAL getservbyport(int,const char*);
++struct servent * PASCAL getservbyname(const char*,const char*);
++struct protoent * PASCAL getprotobynumber(int);
++struct protoent * PASCAL getprotobyname(const char*);
+ int PASCAL WSAStartup(WORD,LPWSADATA);
+ int PASCAL WSACleanup(void);
+ void PASCAL WSASetLastError(int);
+EOF
+
+  # Create shadow headers.
+
+cd /opt/lmi/como/include/min
+for z in *; do cp --preserve /opt/lmi/como/mingw_for_como/include/$z .; done
+patch </opt/lmi/como/MinGW-20010726.patch
+
+  # Configure como, in order to build its C++ standard library.
+
+touch /opt/lmi/como/default.min
+PATH=/opt/lmi/como/bin:/opt/lmi/como/mingw_for_como/bin:$PATH
+export COMO_MIN_INCLUDE=/opt/lmi/como/mingw_for_como/include
+
+  # Build libcomo.
+
+cd /opt/lmi/como/libcomo && ./makeit.bat min
+grep 'warning:\|error:' makeout
+
+  # Patch libcomo.
+  #
+  # This patch must be applied after building libcomo, and before
+  # building lmi. The code commented out here may be a kludge for
+  # getting <istream> to work without including <algorithm>.
+
+cd /opt/lmi/como/libcomo
+cat >libcomo-36.patch <<\EOF
+diff -U3 older/stl_config.h newer/stl_config.h
+--- older/stl_config.h 2008-05-29 10:48:28.000000000 +0000
++++ newer/stl_config.h 2010-12-10 14:40:28.000000000 +0000
+@@ -608,9 +608,9 @@
+      inline long double log10l(long double arg) { return log10(arg); }
+ #endif
+
+-namespace std {
+- inline int min(int a, int b) { return a>b ? b : a; }
+-}
++//namespace std {
++// inline int min(int a, int b) { return a>b ? b : a; }
++//}
+ #endif
+
+ #ifdef __MWERKS__
+EOF
+
+patch <libcomo-36.patch
+
+echo Finished installing como. >/dev/tty
+


Property changes on: lmi/trunk/install_como.sh
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id




reply via email to

[Prev in Thread] Current Thread [Next in Thread]