#ifdef CAN_GENERATE_OBJECTS
kOptObject,
kOptMatchArch,
+ kOptSkipDllExport,
#endif
kOptFilename,
kOptAssembly
UOPTION_DEF("name", 'n', UOPT_REQUIRES_ARG),
UOPTION_DEF("entrypoint", 'e', UOPT_REQUIRES_ARG),
#ifdef CAN_GENERATE_OBJECTS
-/*5*/UOPTION_DEF("object", 'o', UOPT_NO_ARG),
+/*6*/UOPTION_DEF("object", 'o', UOPT_NO_ARG),
UOPTION_DEF("match-arch", 'm', UOPT_REQUIRES_ARG),
+ UOPTION_DEF("skip-dll-export", '\0', UOPT_NO_ARG),
#endif
UOPTION_DEF("filename", 'f', UOPT_REQUIRES_ARG),
UOPTION_DEF("assembly", 'a', UOPT_REQUIRES_ARG)
fprintf(stderr,
"\t-o or --object write a .obj file instead of .c\n"
"\t-m or --match-arch file.o match the architecture (CPU, 32/64 bits) of the specified .o\n"
- "\t ELF format defaults to i386. Windows defaults to the native platform.\n");
+ "\t ELF format defaults to i386. Windows defaults to the native platform.\n"
+ "\t--skip-dll-export Don't export the ICU data entry point symbol (for use when statically linking)\n");
#endif
fprintf(stderr,
"\t-f or --filename Specify an alternate base filename. (default: symbolname_typ)\n"
options[kOptMatchArch].doesOccur ? options[kOptMatchArch].value : NULL,
options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,
NULL,
- 0);
+ 0,
+ !options[kOptSkipDllExport].doesOccur);
break;
#endif
default:
const char *optMatchArch,
const char *optFilename,
char *outFilePath,
- size_t outFilePathCapacity) {
+ size_t outFilePathCapacity,
+ UBool optWinDllExport) {
/* common variables */
char buffer[4096], entry[96]={ 0 };
FileStream *in, *out;
uint16_t cpu, bits;
UBool makeBigEndian;
+ (void)optWinDllExport; /* unused except Windows */
+
/* platform-specific variables and initialization code */
#ifdef U_ELF
/* 32-bit Elf file header */
uprv_memset(&symbolNames, 0, sizeof(symbolNames));
/* write the linker export directive */
- uprv_strcpy(objHeader.linkerOptions, "-export:");
- length=8;
- uprv_strcpy(objHeader.linkerOptions+length, entry);
- length+=entryLength;
- uprv_strcpy(objHeader.linkerOptions+length, ",data ");
- length+=6;
+ if (optWinDllExport) {
+ uprv_strcpy(objHeader.linkerOptions, "-export:");
+ length=8;
+ uprv_strcpy(objHeader.linkerOptions+length, entry);
+ length+=entryLength;
+ uprv_strcpy(objHeader.linkerOptions+length, ",data ");
+ length+=6;
+ }
+ else {
+ length=0;
+ }
/* set the file header */
objHeader.fileHeader.Machine=cpu;