diff options
-rw-r--r-- | cpp/config/Make.rules.Linux | 14 | ||||
-rw-r--r-- | cpp/include/IceUtil/Config.h | 4 | ||||
-rw-r--r-- | cpp/src/IceUtil/Unicode.cpp | 2 | ||||
-rw-r--r-- | cpp/src/icecpp/config.h | 3 |
4 files changed, 18 insertions, 5 deletions
diff --git a/cpp/config/Make.rules.Linux b/cpp/config/Make.rules.Linux index 813319f19f7..ba410e4ad5e 100644 --- a/cpp/config/Make.rules.Linux +++ b/cpp/config/Make.rules.Linux @@ -16,8 +16,20 @@ # This file is included by Make.rules when uname is Linux. # +MACHINE = $(shell uname -m) + CXX = c++ -CXXFLAGS = -ftemplate-depth-128 -fPIC -Wall -D_REENTRANT + +ifeq ($(MACHINE),x86_64) + + ifneq ($(LP64),yes) + CXXARCHFLAGS := -m32 + endif + + lp64dir := lib64 +endif + +CXXFLAGS = $(CXXARCHFLAGS) -ftemplate-depth-128 -fPIC -Wall -D_REENTRANT ifeq ($(OPTIMIZE),yes) CXXFLAGS := -O2 -DNDEBUG $(CXXFLAGS) diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 1a3c57c14cb..3e41841983c 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -21,7 +21,7 @@ // Most CPUs support only one endianness, with the notable exceptions // of Itanium (IA64) and MIPS. // -#if defined(__i386) || defined(_M_IX86) +#if defined(__i386) || defined(_M_IX86) || defined (__x86_64) # define ICE_LITTLE_ENDIAN #elif defined(__sparc) # define ICE_BIG_ENDIAN @@ -32,7 +32,7 @@ // // 32 or 64 bit mode? // -#if (defined(__sun) && defined(__sparcv9)) +#if (defined(__sun) && defined(__sparcv9)) || (defined(__linux) && defined(__x86_64)) # define ICE_64 #else # define ICE_32 diff --git a/cpp/src/IceUtil/Unicode.cpp b/cpp/src/IceUtil/Unicode.cpp index 4a7537a1308..c4ea2d36b16 100644 --- a/cpp/src/IceUtil/Unicode.cpp +++ b/cpp/src/IceUtil/Unicode.cpp @@ -18,7 +18,7 @@ #if defined(_WIN32) # define SIZEOF_WCHAR_T 2 #elif (defined(__sun) && defined(__sparc)) || \ - ((defined(__linux) || defined(__FreeBSD__)) && defined (__i386)) + ((defined(__linux) || defined(__FreeBSD__)) && (defined(__i386) || defined(__x86_64))) # define SIZEOF_WCHAR_T 4 #endif diff --git a/cpp/src/icecpp/config.h b/cpp/src/icecpp/config.h index b1949ec2d0b..cb8a4568706 100644 --- a/cpp/src/icecpp/config.h +++ b/cpp/src/icecpp/config.h @@ -57,7 +57,8 @@ #define LONG_TYPE_SIZE 4 #if defined(_WIN32) # define WCHAR_TYPE_SIZE 2 -#elif (defined(__linux__) || defined(__FreeBSD__)) && defined(i386) || defined (__sun) +#elif (defined(__linux) || defined(__FreeBSD__)) && (defined(__i386) || defined(__x86_64)) \ + || defined (__sun) # define WCHAR_TYPE_SIZE 4 #else # error "unsupported operating system or platform" |