Since icu provides no way to set the soname version, we abuse the LIB_EXT_ORDER= pair in the icupkg.inc file (produced by pkgdataMakefile files: Wrt. the original source, only the first character is used to decide, whether the 'so' extension of generated libfilenames gets prefixed with a '.' (yes, if LIB_EXT_ORDER starts with a dot). All other characters are paperweight. This patch utilizes them by using all digits after the dot as so version number. So LIB_EXT_ORDER=.7 is, what we would use to get -h libicudata.so.7 behavior. We keep the original versioning scheme for the real file, i.e. $libname.so.$fullversion - easier for people to see, what ICU version they use. --- ./source/tools/pkgdata/pkgdata.cpp.orig Fri Mar 27 22:10:54 2015 +++ ./source/tools/pkgdata/pkgdata.cpp Thu Jul 30 10:52:46 2015 @@ -242,8 +242,16 @@ "Add package to all file names if not present", "Library name to build (if different than package name)", "Quite mode. (e.g. Do not output a readme file for static libraries)", +#ifdef BUILD_DATA_WITHOUT_ASSEMBLY "Build the data without assembly code", - "Build PDS dataset (zOS build only)" +#else + "Build the data without assembly code (ignored on this platform)", +#endif +#if U_PLATFORM == U_PF_OS390 + "Build PDS dataset on zOS" +#else + "Build PDS dataset on zOS (ignored on this platform)" +#endif }; const char *progname = "PKGDATA"; @@ -383,17 +391,12 @@ o.quiet = FALSE; } - if(options[PDS_BUILD].doesOccur) { + o.pdsbuild = FALSE; #if U_PLATFORM == U_PF_OS390 + if(options[PDS_BUILD].doesOccur) { o.pdsbuild = TRUE; -#else - o.pdsbuild = FALSE; - fprintf(stdout, "Warning: You are using the -z option which only works on z/OS.\n"); - -#endif - } else { - o.pdsbuild = FALSE; } +#endif o.verbose = options[VERBOSE].doesOccur; @@ -444,14 +447,11 @@ } o.withoutAssembly = FALSE; +#ifdef BUILD_DATA_WITHOUT_ASSEMBLY if (options[WITHOUT_ASSEMBLY].doesOccur) { -#ifndef BUILD_DATA_WITHOUT_ASSEMBLY - fprintf(stdout, "Warning: You are using the option to build without assembly code which is not supported on this platform.\n"); - fprintf(stdout, "Warning: This option will be ignored.\n"); -#else o.withoutAssembly = TRUE; -#endif } +#endif /* OK options are set up. Now the file lists. */ tail = NULL; @@ -636,7 +636,21 @@ #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN) /* Get the version major number. */ - if (o->version != NULL) { + if (pkgDataFlags[LIB_EXT_ORDER][0] != '\0') { + /* the first char is expected to be a dot */ + for (uint32_t i = 0;i < sizeof(version_major);i++) { + char c = pkgDataFlags[LIB_EXT_ORDER][i+1]; + if (c < '0' || c > '9') { + if (i == 0) { + version_major[i] = '0'; + i++; + } + version_major[i] = '\0'; + break; + } + version_major[i] = c; + } + } else if (o->version != NULL) { for (uint32_t i = 0;i < sizeof(version_major);i++) { if (o->version[i] == '.') { version_major[i] = 0; @@ -650,6 +664,7 @@ fprintf(stdout, "Warning: Providing a revision number with the -r option is recommended when packaging data in the current mode.\n"); } } + version_major[sizeof(version_major)-1] = '\0'; #if U_PLATFORM != U_PF_OS400 /* Certain platforms have different library extension ordering. (e.g. libicudata.##.so vs libicudata.so.##) @@ -729,9 +744,6 @@ if (o->withoutAssembly) { #ifdef BUILD_DATA_WITHOUT_ASSEMBLY result = pkg_createWithoutAssemblyCode(o, targetDir, mode); -#else - /* This error should not occur. */ - fprintf(stderr, "Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined. Internal error.\n"); #endif } else { #ifdef CAN_WRITE_OBJ_CODE