summaryrefslogtreecommitdiffstats
path: root/icu.6969.pkgdata.patch
blob: 094b0bf8d29b792339596aac1465d4ab06bf526c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
Index: source/tools/pkgdata/pkgdata.cpp
===================================================================
--- source.orig/tools/pkgdata/pkgdata.cpp	2009-06-26 14:57:38.000000000 -0400
+++ source/tools/pkgdata/pkgdata.cpp	2009-06-27 10:12:08.437285758 -0400
@@ -118,6 +118,7 @@
 static void createFileNames(const char *version_major, const char *version, const char *libName, const UBool reverseExt);
 
 static int32_t pkg_getOptionsFromICUConfig(UOption *option);
+static int runCommand(const char* command);
 
 enum {
     NAME,
@@ -461,6 +462,17 @@
     return result;
 }
 
+static int runCommand(const char* command)
+{
+    printf("pkgdata: %s\n", command);
+    int result = system(command);
+    if (result != 0)
+    {
+	printf("-- return status = %d\n", result);
+    }
+    return result;
+}
+
 #define LN_CMD "ln -s"
 #define RM_CMD "rm -f"
 
@@ -724,7 +736,7 @@
             LN_CMD,
             libFileNames[LIB_FILE_VERSION],
             libFileNames[LIB_FILE_VERSION_MAJOR]);
-    result = system(cmd);
+    result = runCommand(cmd);
     if (result != 0) {
         return result;
     }
@@ -737,7 +749,7 @@
             libFileNames[LIB_FILE_VERSION],
             libFileNames[LIB_FILE], pkgDataFlags[SO_EXT]);
 
-     result = system(cmd);
+     result = runCommand(cmd);
 
     return result;
 }
@@ -753,7 +765,7 @@
             installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION]
             );
 
-    result = system(cmd);
+    result = runCommand(cmd);
 
     if (result != 0) {
         return result;
@@ -795,7 +807,7 @@
                         srcDir, PKGDATA_FILE_SEP_STRING, buffer,
                         installDir, PKGDATA_FILE_SEP_STRING, buffer);
 
-                result = system(cmd);
+                result = runCommand(cmd);
                 if (result != 0) {
                     fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
                     break;
@@ -815,7 +827,7 @@
     }
 #else
     sprintf(cmd, "%s %s %s %s", WIN_INSTALL_CMD, srcDir, installDir, WIN_INSTALL_CMD_FLAGS);
-    result = system(cmd);
+    result = runCommand(cmd);
     if (result != 0) {
         fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
     }
@@ -849,7 +861,17 @@
                 targetDir,
                 libFileNames[LIB_FILE_VERSION_TMP]);
 
-        result = system(cmd);
+        result = runCommand(cmd);
+        if (result != 0) {
+            return result;
+        }
+
+        sprintf(cmd, "%s %s%s",
+                pkgDataFlags[RANLIB],
+                targetDir,
+                libFileNames[LIB_FILE_VERSION]);
+
+        result = runCommand(cmd);
         if (result != 0) {
             return result;
         }
@@ -860,7 +882,7 @@
                 targetDir,
                 libFileNames[LIB_FILE_VERSION_TMP]);
 
-        result = system(cmd);
+        result = runCommand(cmd);
         if (result != 0) {
             return result;
         }
@@ -908,7 +930,21 @@
                 pkgDataFlags[A_EXT],
                 objectFile);
 
-        result = system(cmd);
+        result = runCommand(cmd);
+        if (result == 0)
+        {
+#ifdef OS400
+            sprintf(cmd, "QSH CMD('%s %s%s.%s')",
+#else
+            sprintf(cmd, "%s %s%s.%s",
+#endif
+                pkgDataFlags[RANLIB],
+                targetDir,
+                libFileNames[LIB_FILE],
+                pkgDataFlags[A_EXT]);
+
+            result = runCommand(cmd);
+        }
     } else /* if (mode == MODE_DLL) */ {
 #ifdef U_CYGWIN
         sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
@@ -935,7 +971,7 @@
                 pkgDataFlags[BIR_FLAGS]);
 
         /* Generate the library file. */
-        result = system(cmd);
+        result = runCommand(cmd);
     }
 
     if (freeCmd) {
@@ -961,7 +997,7 @@
             tempObjectFile,
             gencFilePath);
 
-    result = system(cmd);
+    result = runCommand(cmd);
     if (result != 0) {
         return result;
     }
@@ -1043,7 +1079,7 @@
                         tempObjectFile,
                         gencmnFile);
             
-            result = system(cmd);
+            result = runCommand(cmd);
             if (result != 0) {
                 break;
             }
@@ -1094,7 +1130,7 @@
             sprintf(cmd, "cat %s >> %s", gencmnFile, icudtAll);
 #endif
             
-            result = system(cmd);
+            result = runCommand(cmd);
             if (result != 0) {
                 break;
             }
@@ -1110,7 +1146,7 @@
                     pkgDataFlags[LIBFLAGS],
                     tempObjectFile,
                     gencmnFile);
-        result = system(cmd);
+        result = runCommand(cmd);
         if (result != 0) {
             break;
         }
@@ -1139,7 +1175,7 @@
         tempObjectFile,
         icudtAll);
     
-    result = system(cmd);
+    result = runCommand(cmd);
     if (result == 0) {
         sprintf(buffer, "%s %s",
             buffer,
@@ -1222,7 +1258,7 @@
                 );
     }
 
-    return system(cmd);
+    return runCommand(cmd);
 }
 #endif