|
1 /****************************************************************************** |
|
2 * Copyright (C) 2008-2011, International Business Machines |
|
3 * Corporation and others. All Rights Reserved. |
|
4 ******************************************************************************* |
|
5 */ |
|
6 |
|
7 #ifndef __PKG_GENC_H__ |
|
8 #define __PKG_GENC_H__ |
|
9 |
|
10 #include "unicode/utypes.h" |
|
11 #include "toolutil.h" |
|
12 |
|
13 #include "unicode/putil.h" |
|
14 #include "putilimp.h" |
|
15 |
|
16 /*** Platform #defines move here ***/ |
|
17 #if U_PLATFORM_HAS_WIN32_API |
|
18 #ifdef __GNUC__ |
|
19 #define WINDOWS_WITH_GNUC |
|
20 #else |
|
21 #define WINDOWS_WITH_MSVC |
|
22 #endif |
|
23 #endif |
|
24 |
|
25 |
|
26 #if !defined(WINDOWS_WITH_MSVC) |
|
27 #define BUILD_DATA_WITHOUT_ASSEMBLY |
|
28 #endif |
|
29 |
|
30 #ifndef U_DISABLE_OBJ_CODE /* testing */ |
|
31 #if defined(WINDOWS_WITH_MSVC) || U_PLATFORM_IS_LINUX_BASED |
|
32 #define CAN_WRITE_OBJ_CODE |
|
33 #endif |
|
34 #if U_PLATFORM_HAS_WIN32_API || defined(U_ELF) |
|
35 #define CAN_GENERATE_OBJECTS |
|
36 #endif |
|
37 #endif |
|
38 |
|
39 #if U_PLATFORM == U_PF_CYGWIN || defined(CYGWINMSVC) |
|
40 #define USING_CYGWIN |
|
41 #endif |
|
42 |
|
43 /* |
|
44 * When building the data library without assembly, |
|
45 * some platforms use a single c code file for all of |
|
46 * the data to generate the final data library. This can |
|
47 * increase the performance of the pkdata tool. |
|
48 */ |
|
49 #if U_PLATFORM == U_PF_OS400 |
|
50 #define USE_SINGLE_CCODE_FILE |
|
51 #endif |
|
52 |
|
53 /* Need to fix the file seperator character when using MinGW. */ |
|
54 #if defined(WINDOWS_WITH_GNUC) || defined(USING_CYGWIN) |
|
55 #define PKGDATA_FILE_SEP_STRING "/" |
|
56 #else |
|
57 #define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING |
|
58 #endif |
|
59 |
|
60 #define LARGE_BUFFER_MAX_SIZE 2048 |
|
61 #define SMALL_BUFFER_MAX_SIZE 512 |
|
62 #define SMALL_BUFFER_FLAG_NAMES 32 |
|
63 #define BUFFER_PADDING_SIZE 20 |
|
64 |
|
65 /** End platform defines **/ |
|
66 |
|
67 |
|
68 |
|
69 U_INTERNAL void U_EXPORT2 |
|
70 printAssemblyHeadersToStdErr(void); |
|
71 |
|
72 U_INTERNAL UBool U_EXPORT2 |
|
73 checkAssemblyHeaderName(const char* optAssembly); |
|
74 |
|
75 U_INTERNAL void U_EXPORT2 |
|
76 writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath); |
|
77 |
|
78 U_INTERNAL void U_EXPORT2 |
|
79 writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath); |
|
80 |
|
81 U_INTERNAL void U_EXPORT2 |
|
82 writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath); |
|
83 |
|
84 #endif |