Line
Link Here
|
0 |
-- tools/pkgdata/pkgdata.cpp |
0 |
++ tools/pkgdata/pkgdata.cpp |
Lines 118-123
Link Here
|
118 |
static void createFileNames(const char *version_major, const char *version, const char *libName, const UBool reverseExt); |
118 |
static void createFileNames(const char *version_major, const char *version, const char *libName, const UBool reverseExt); |
119 |
|
119 |
|
120 |
static int32_t pkg_getOptionsFromICUConfig(UOption *option); |
120 |
static int32_t pkg_getOptionsFromICUConfig(UOption *option); |
|
|
121 |
static int runCommand(const char* command); |
121 |
|
122 |
|
122 |
enum { |
123 |
enum { |
123 |
NAME, |
124 |
NAME, |
Lines 461-466
Link Here
|
461 |
return result; |
462 |
return result; |
462 |
} |
463 |
} |
463 |
|
464 |
|
|
|
465 |
static int runCommand(const char* command) { |
466 |
printf("pkgdata: %s\n", command); |
467 |
int result = system(command); |
468 |
if (result != 0) { |
469 |
printf("-- return status = %d\n", result); |
470 |
} |
471 |
return result; |
472 |
} |
473 |
|
464 |
#define LN_CMD "ln -s" |
474 |
#define LN_CMD "ln -s" |
465 |
#define RM_CMD "rm -f" |
475 |
#define RM_CMD "rm -f" |
466 |
|
476 |
|
Lines 724-730
Link Here
|
724 |
LN_CMD, |
734 |
LN_CMD, |
725 |
libFileNames[LIB_FILE_VERSION], |
735 |
libFileNames[LIB_FILE_VERSION], |
726 |
libFileNames[LIB_FILE_VERSION_MAJOR]); |
736 |
libFileNames[LIB_FILE_VERSION_MAJOR]); |
727 |
result = system(cmd); |
737 |
result = runCommand(cmd); |
728 |
if (result != 0) { |
738 |
if (result != 0) { |
729 |
return result; |
739 |
return result; |
730 |
} |
740 |
} |
Lines 737-743
Link Here
|
737 |
libFileNames[LIB_FILE_VERSION], |
747 |
libFileNames[LIB_FILE_VERSION], |
738 |
libFileNames[LIB_FILE], pkgDataFlags[SO_EXT]); |
748 |
libFileNames[LIB_FILE], pkgDataFlags[SO_EXT]); |
739 |
|
749 |
|
740 |
result = system(cmd); |
750 |
result = runCommand(cmd); |
741 |
|
751 |
|
742 |
return result; |
752 |
return result; |
743 |
} |
753 |
} |
Lines 753-759
Link Here
|
753 |
installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION] |
763 |
installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION] |
754 |
); |
764 |
); |
755 |
|
765 |
|
756 |
result = system(cmd); |
766 |
result = runCommand(cmd); |
757 |
|
767 |
|
758 |
if (result != 0) { |
768 |
if (result != 0) { |
759 |
return result; |
769 |
return result; |
Lines 795-801
Link Here
|
795 |
srcDir, PKGDATA_FILE_SEP_STRING, buffer, |
805 |
srcDir, PKGDATA_FILE_SEP_STRING, buffer, |
796 |
installDir, PKGDATA_FILE_SEP_STRING, buffer); |
806 |
installDir, PKGDATA_FILE_SEP_STRING, buffer); |
797 |
|
807 |
|
798 |
result = system(cmd); |
808 |
result = runCommand(cmd); |
799 |
if (result != 0) { |
809 |
if (result != 0) { |
800 |
fprintf(stderr, "Failed to install data file with command: %s\n", cmd); |
810 |
fprintf(stderr, "Failed to install data file with command: %s\n", cmd); |
801 |
break; |
811 |
break; |
Lines 815-821
Link Here
|
815 |
} |
825 |
} |
816 |
#else |
826 |
#else |
817 |
sprintf(cmd, "%s %s %s %s", WIN_INSTALL_CMD, srcDir, installDir, WIN_INSTALL_CMD_FLAGS); |
827 |
sprintf(cmd, "%s %s %s %s", WIN_INSTALL_CMD, srcDir, installDir, WIN_INSTALL_CMD_FLAGS); |
818 |
result = system(cmd); |
828 |
result = runCommand(cmd); |
819 |
if (result != 0) { |
829 |
if (result != 0) { |
820 |
fprintf(stderr, "Failed to install data file with command: %s\n", cmd); |
830 |
fprintf(stderr, "Failed to install data file with command: %s\n", cmd); |
821 |
} |
831 |
} |
Lines 849-855
Link Here
|
849 |
targetDir, |
859 |
targetDir, |
850 |
libFileNames[LIB_FILE_VERSION_TMP]); |
860 |
libFileNames[LIB_FILE_VERSION_TMP]); |
851 |
|
861 |
|
852 |
result = system(cmd); |
862 |
result = runCommand(cmd); |
|
|
863 |
if (result != 0) { |
864 |
return result; |
865 |
} |
866 |
|
867 |
sprintf(cmd, "%s %s%s", |
868 |
pkgDataFlags[RANLIB], |
869 |
targetDir, |
870 |
libFileNames[LIB_FILE_VERSION]); |
871 |
|
872 |
result = runCommand(cmd); |
853 |
if (result != 0) { |
873 |
if (result != 0) { |
854 |
return result; |
874 |
return result; |
855 |
} |
875 |
} |
Lines 860-866
Link Here
|
860 |
targetDir, |
880 |
targetDir, |
861 |
libFileNames[LIB_FILE_VERSION_TMP]); |
881 |
libFileNames[LIB_FILE_VERSION_TMP]); |
862 |
|
882 |
|
863 |
result = system(cmd); |
883 |
result = runCommand(cmd); |
864 |
if (result != 0) { |
884 |
if (result != 0) { |
865 |
return result; |
885 |
return result; |
866 |
} |
886 |
} |
Lines 908-914
Link Here
|
908 |
pkgDataFlags[A_EXT], |
928 |
pkgDataFlags[A_EXT], |
909 |
objectFile); |
929 |
objectFile); |
910 |
|
930 |
|
911 |
result = system(cmd); |
931 |
result = runCommand(cmd); |
|
|
932 |
if (result == 0) |
933 |
{ |
934 |
#ifdef OS400 |
935 |
sprintf(cmd, "QSH CMD('%s %s%s.%s')", |
936 |
#else |
937 |
sprintf(cmd, "%s %s%s.%s", |
938 |
#endif |
939 |
pkgDataFlags[RANLIB], |
940 |
targetDir, |
941 |
libFileNames[LIB_FILE], |
942 |
pkgDataFlags[A_EXT]); |
943 |
|
944 |
result = runCommand(cmd); |
945 |
} |
912 |
} else /* if (mode == MODE_DLL) */ { |
946 |
} else /* if (mode == MODE_DLL) */ { |
913 |
#ifdef U_CYGWIN |
947 |
#ifdef U_CYGWIN |
914 |
sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s", |
948 |
sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s", |
Lines 935-941
Link Here
|
935 |
pkgDataFlags[BIR_FLAGS]); |
969 |
pkgDataFlags[BIR_FLAGS]); |
936 |
|
970 |
|
937 |
/* Generate the library file. */ |
971 |
/* Generate the library file. */ |
938 |
result = system(cmd); |
972 |
result = runCommand(cmd); |
939 |
} |
973 |
} |
940 |
|
974 |
|
941 |
if (freeCmd) { |
975 |
if (freeCmd) { |
Lines 961-967
Link Here
|
961 |
tempObjectFile, |
995 |
tempObjectFile, |
962 |
gencFilePath); |
996 |
gencFilePath); |
963 |
|
997 |
|
964 |
result = system(cmd); |
998 |
result = runCommand(cmd); |
965 |
if (result != 0) { |
999 |
if (result != 0) { |
966 |
return result; |
1000 |
return result; |
967 |
} |
1001 |
} |
Lines 1043-1049
Link Here
|
1043 |
tempObjectFile, |
1077 |
tempObjectFile, |
1044 |
gencmnFile); |
1078 |
gencmnFile); |
1045 |
|
1079 |
|
1046 |
result = system(cmd); |
1080 |
result = runCommand(cmd); |
1047 |
if (result != 0) { |
1081 |
if (result != 0) { |
1048 |
break; |
1082 |
break; |
1049 |
} |
1083 |
} |
Lines 1094-1100
Link Here
|
1094 |
sprintf(cmd, "cat %s >> %s", gencmnFile, icudtAll); |
1128 |
sprintf(cmd, "cat %s >> %s", gencmnFile, icudtAll); |
1095 |
#endif |
1129 |
#endif |
1096 |
|
1130 |
|
1097 |
result = system(cmd); |
1131 |
result = runCommand(cmd); |
1098 |
if (result != 0) { |
1132 |
if (result != 0) { |
1099 |
break; |
1133 |
break; |
1100 |
} |
1134 |
} |
Lines 1110-1116
Link Here
|
1110 |
pkgDataFlags[LIBFLAGS], |
1144 |
pkgDataFlags[LIBFLAGS], |
1111 |
tempObjectFile, |
1145 |
tempObjectFile, |
1112 |
gencmnFile); |
1146 |
gencmnFile); |
1113 |
result = system(cmd); |
1147 |
result = runCommand(cmd); |
1114 |
if (result != 0) { |
1148 |
if (result != 0) { |
1115 |
break; |
1149 |
break; |
1116 |
} |
1150 |
} |
Lines 1139-1145
Link Here
|
1139 |
tempObjectFile, |
1173 |
tempObjectFile, |
1140 |
icudtAll); |
1174 |
icudtAll); |
1141 |
|
1175 |
|
1142 |
result = system(cmd); |
1176 |
result = runCommand(cmd); |
1143 |
if (result == 0) { |
1177 |
if (result == 0) { |
1144 |
sprintf(buffer, "%s %s", |
1178 |
sprintf(buffer, "%s %s", |
1145 |
buffer, |
1179 |
buffer, |
Lines 1222-1228
Link Here
|
1222 |
); |
1256 |
); |
1223 |
} |
1257 |
} |
1224 |
|
1258 |
|
1225 |
return system(cmd); |
1259 |
return runCommand(cmd); |
1226 |
} |
1260 |
} |
1227 |
#endif |
1261 |
#endif |
1228 |
|
1262 |
|