Project

General

Profile

RE: build exiv2-0.23 with solarisstudio compiler 12.3 Er... » exiv2_0.23-cmake_build_with_ss12_3_sol11_1.txt

James McPherson, 05 Apr 2013 05:52

 
1
####
2
####
3
#### environment flags used
4
#### CC=cc
5
#### CFLAGS=-D__SUNOS__=1 -D__unix__=1 -D__SSE3__ -D__SSE__ -D__SSE2__ -D__SSE4__ -DOS_SOLARIS=1 -lumem -xO3 -xarch=sse3 -R/opt/darktable/lib -lumem 
6
#### CXX=CC
7
#### CXXFLAGS=-D__SUNOS__=1 -D__unix__=1 -D__SSE3__ -D__SSE__ -D__SSE2__ -D__SSE4__ -DOS_SOLARIS=1 -lumem -xO3 -xarch=sse3 -library=stdcxx4 -R/opt/darktable/lib -lumem 
8
#### LDFLAGS=-R/opt/darktable/lib -lumem 
9
#### PATH=/opt/SUNWspro/solarisstudio12.3/bin:/usr/perl5/bin:/opt/local/bin:/usr/gcc/4.6/bin/:/usr/bin:/usr/sbin:/bin:/sbin:/usr/dt/bin:/usr/sfw/bin:/usr/gnu/bin:
10

    
11
####
12
#### This was for a CMake build. The CMake command line was
13
#### mkdir build && cd build 
14
#### cmake ..  -DCMAKE_INSTALL_PREFIX=/opt/darktable -DCMAKE_INSTALL_RPATH=/opt/darktable:/usr/lib
15
####
16

    
17
Index: src/matroskavideo.cpp
18
===================================================================
19
--- src/matroskavideo.cpp	(revision 3014)
20
+++ src/matroskavideo.cpp	(working copy)
21
@@ -457,7 +457,7 @@
22
         int64_t temp = 0;
23
 
24
         for(int i = size-1; i >= 0; i--) {
25
-            temp = temp + static_cast<int64_t>(buf[i]*(pow(256.0, size-i-1)));
26
+            temp = temp + static_cast<int64_t>(buf[i]*(pow(256.0, (double)size-i-1)));
27
         }
28
 // Todo: remove debug output
29
 //        std::cerr << "size = " << size << ", val = " << temp << std::hex << " (0x" << temp << std::dec << ")";
30
Index: src/rcsid_int.hpp
31
===================================================================
32
--- src/rcsid_int.hpp	(revision 3014)
33
+++ src/rcsid_int.hpp	(working copy)
34
@@ -55,7 +55,8 @@
35
 
36
 #ifndef  __clang__
37
 #define EXIV2_RCSID(id) \
38
-    namespace { \
39
+//    namespace { \
40
+    { \
41
         inline const char* getRcsId(const char*) { return id ; } \
42
         const char* rcsId = getRcsId(rcsId); \
43
     }
44
Index: src/quicktimevideo.cpp
45
===================================================================
46
--- src/quicktimevideo.cpp	(revision 3014)
47
+++ src/quicktimevideo.cpp	(working copy)
48
@@ -1,4 +1,4 @@
49
-// ***************************************************************** -*- C++ -*-
50
+// ***************************************************************** -*- C++ -*-
51
 /*
52
  * Copyright (C) 2004-2012 Andreas Huggel <ahuggel@gmx.net>
53
  *
54
@@ -559,7 +559,7 @@
55
 #ifdef _MSC_VER
56
             temp = temp + static_cast<int64_t>(buf.pData_[i]*(pow(static_cast<float>(256), n-i-1)));
57
 #else
58
-			temp = temp + buf.pData_[i]*(pow(256,n-i-1));
59
+	temp = temp + buf.pData_[i]*(pow((float)256,n-i-1));
60
 #endif
61
 
62
         return temp;
63
@@ -577,7 +577,7 @@
64
 #if _MSC_VER
65
 			temp = temp + static_cast<uint64_t>(buf.pData_[i]*(pow(static_cast<float>(256), n-i-1)));
66
 #else
67
-			temp = temp + buf.pData_[i]*(pow(256,n-i-1));
68
+	temp = temp + buf.pData_[i]*(pow((float)256,n-i-1));
69
 #endif
70
 
71
         return temp;
72
Index: xmpsdk/include/XMP_Environment.h
73
===================================================================
74
--- xmpsdk/include/XMP_Environment.h	(revision 3014)
75
+++ xmpsdk/include/XMP_Environment.h	(working copy)
76
@@ -27,7 +27,11 @@
77
 // macros with 0 or 1 values.
78
 
79
 /* 20-Oct-07, ahu: Determine the platform, set the above defines accordingly.                     */
80
+
81
+#if !defined(_FILE_OFFSET_BITS)
82
 #define _FILE_OFFSET_BITS 64
83
+#endif
84
+
85
 #if defined __CYGWIN32__ && !defined __CYGWIN__
86
    /* For backwards compatibility with Cygwin b19 and
87
       earlier, we define __CYGWIN__ here, so that
88
@@ -139,3 +143,20 @@
89
 // =================================================================================================
90
 
91
 #endif  // __XMP_Environment_h__
92
+
93
+/*
94
+  If you're using Solaris and the Solaris Studio compiler, then you really
95
+  do need to use -library=stdcxx4 along with these inclusions below
96
+*/
97
+#if defined(OS_SOLARIS)
98
+#include <stdio.h>
99
+#include <string.h>
100
+#include <strings.h>
101
+#include <stdlib.h>
102
+#include <math.h>
103
+#if defined(__cplusplus)
104
+#include <ios>
105
+#include <fstream>
106
+#endif
107
+#endif
108
+
109
Index: CMakeLists.txt
110
===================================================================
111
--- CMakeLists.txt	(revision 3014)
112
+++ CMakeLists.txt	(working copy)
113
@@ -53,7 +53,8 @@
114
 OPTION( EXIV2_ENABLE_BUILD_PO      "Build translations files"                              OFF )
115
 
116
 IF( MINGW OR UNIX )
117
-    ADD_DEFINITIONS(-Wall
118
+    IF ( CMAKE_CXX_COMPILER STREQUAL "g++" OR CMAKE_C_COMPILER STREQUAL "gcc" ) 
119
+        ADD_DEFINITIONS(-Wall
120
                     -Wcast-align
121
                     -Wpointer-arith
122
                     -Wformat-security
123
@@ -61,6 +62,7 @@
124
                     -Woverloaded-virtual
125
                     -W
126
                    )
127
+    ENDIF()
128
 ENDIF( MINGW OR UNIX )
129
 
130
 
131
Index: samples/geotag.cpp
132
===================================================================
133
--- samples/geotag.cpp	(revision 3014)
134
+++ samples/geotag.cpp	(working copy)
135
@@ -404,15 +404,20 @@
136
 {
137
     time_t    now   = time(NULL);
138
     struct tm local = *localtime(&now) ;
139
+    int offset;
140
 
141
 #if   defined(_MSC_VER)
142
     TIME_ZONE_INFORMATION TimeZoneInfo;
143
     GetTimeZoneInformation( &TimeZoneInfo );
144
-    int offset = - (((int)TimeZoneInfo.Bias + (int)TimeZoneInfo.DaylightBias) * 60);
145
+    offset = - (((int)TimeZoneInfo.Bias + (int)TimeZoneInfo.DaylightBias) * 60);
146
 #elif defined(__CYGWIN__)
147
     struct tm lcopy  = *localtime(&now);
148
     time_t    gmt    =  timegm(&lcopy) ; // timegm modifies lcopy, so don't use local
149
-    int       offset = (int) ( ((long signed int) gmt) - ((long signed int) now) ) ;
150
+              offset = (int) ( ((long signed int) gmt) - ((long signed int) now) ) ;
151
+#elif defined(OS_SOLARIS)
152
+    time_t local_tt = (int) mktime(&local);
153
+    time_t time_gmt = (int) mktime(gmtime(&now));
154
+    offset = time_gmt - local_tt;
155
 #else
156
     int offset = local.tm_gmtoff ;
157
 #endif
158
Index: config/config.h.in
159
===================================================================
160
--- config/config.h.in	(revision 3014)
161
+++ config/config.h.in	(working copy)
162
@@ -246,3 +246,20 @@
163
 #else
164
 # define EXIV2API
165
 #endif /* ! EXV_HAVE_DLL */
166
+
167
+/*
168
+  If you're using Solaris and the Solaris Studio compiler, then you really
169
+  do need to use -library=stdcxx4 along with these inclusions below
170
+*/
171
+#if defined(OS_SOLARIS)
172
+#include <stdio.h>
173
+#include <string.h>
174
+#include <strings.h>
175
+#include <stdlib.h>
176
+#include <math.h>
177
+#if defined(__cplusplus)
178
+#include <ios>
179
+#include <fstream>
180
+#endif
181
+#endif
182
+
183
Index: config/config.h.cmake
184
===================================================================
185
--- config/config.h.cmake	(revision 3014)
186
+++ config/config.h.cmake	(working copy)
187
@@ -246,3 +246,20 @@
188
 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
189
 # pragma warning(disable : 4996 4251)
190
 #endif
191
+
192
+/*
193
+  If you're using Solaris and the Solaris Studio compiler, then you really
194
+  do need to use -library=stdcxx4 along with these inclusions below
195
+*/
196
+#if defined(OS_SOLARIS)
197
+#include <stdio.h>
198
+#include <string.h>
199
+#include <strings.h>
200
+#include <stdlib.h>
201
+#include <math.h>
202
+#if defined(__cplusplus)
203
+#include <ios>
204
+#include <fstream>
205
+#endif
206
+#endif
207
+
    (1-1/1)