Skip to content

Commit

Permalink
build: add required ICU patch changes
Browse files Browse the repository at this point in the history
Added new folder to include when dealing with ICU patches folder.
Copied .h files to patches folder to fix include issues.
  • Loading branch information
StefanStojanovic committed Aug 22, 2024
1 parent ec0852d commit 06d34c4
Show file tree
Hide file tree
Showing 5 changed files with 396 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,7 @@ def icu_download(path):
'genccode': 'tools/genccode',
'genrb': 'tools/genrb',
'icupkg': 'tools/icupkg',
'pkgdata': 'tools/pkgdata',
}
# this creates a variable icu_src_XXX for each of the subdirs
# with a list of the src files to use
Expand Down
1 change: 1 addition & 0 deletions tools/icu/icu-generic.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
'<@(icu_src_common)',
'<@(icu_src_i18n)',
'<@(icu_src_stubdata)',
'<@(icu_src_pkgdata)',
],
'sources!': [
'<(icu_path)/source/tools/toolutil/udbgutil.cpp',
Expand Down
111 changes: 111 additions & 0 deletions tools/icu/patches/75/source/tools/genccode/pkg_genc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2008-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/

#ifndef __PKG_GENC_H__
#define __PKG_GENC_H__

#include "unicode/utypes.h"
#include "toolutil.h"

#include "unicode/putil.h"
#include "putilimp.h"

/*** Platform #defines move here ***/
#if U_PLATFORM_HAS_WIN32_API
#ifdef __GNUC__
#define WINDOWS_WITH_GNUC
#else
#define WINDOWS_WITH_MSVC
#endif
#endif


#if !defined(WINDOWS_WITH_MSVC)
#define BUILD_DATA_WITHOUT_ASSEMBLY
#endif

#ifndef U_DISABLE_OBJ_CODE /* testing */
#if defined(WINDOWS_WITH_MSVC) || U_PLATFORM_IS_LINUX_BASED
#define CAN_WRITE_OBJ_CODE
#endif
#if U_PLATFORM_HAS_WIN32_API || defined(U_ELF)
#define CAN_GENERATE_OBJECTS
#endif
#endif

#if U_PLATFORM == U_PF_CYGWIN || defined(CYGWINMSVC)
#define USING_CYGWIN
#endif

/*
* When building the data library without assembly,
* some platforms use a single c code file for all of
* the data to generate the final data library. This can
* increase the performance of the pkdata tool.
*/
#if U_PLATFORM == U_PF_OS400
#define USE_SINGLE_CCODE_FILE
#endif

/* Need to fix the file seperator character when using MinGW. */
#if defined(WINDOWS_WITH_GNUC) || defined(USING_CYGWIN)
#define PKGDATA_FILE_SEP_STRING "/"
#else
#define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING
#endif

#define LARGE_BUFFER_MAX_SIZE 2048
#define SMALL_BUFFER_MAX_SIZE 512
#define SMALL_BUFFER_FLAG_NAMES 32
#define BUFFER_PADDING_SIZE 20

/** End platform defines **/



U_CAPI void U_EXPORT2
printAssemblyHeadersToStdErr(void);

U_CAPI UBool U_EXPORT2
checkAssemblyHeaderName(const char* optAssembly);

U_CAPI UBool U_EXPORT2
checkCpuArchitecture(const char* optCpuArch);

U_CAPI void U_EXPORT2
writeCCode(
const char *filename,
const char *destdir,
const char *optEntryPoint,
const char *optName,
const char *optFilename,
char *outFilePath,
size_t outFilePathCapacity);

U_CAPI void U_EXPORT2
writeAssemblyCode(
const char *filename,
const char *destdir,
const char *optEntryPoint,
const char *optFilename,
char *outFilePath,
size_t outFilePathCapacity);

U_CAPI void U_EXPORT2
writeObjectCode(
const char *filename,
const char *destdir,
const char *optEntryPoint,
const char *optMatchArch,
const char *optCpuArch,
const char *optFilename,
char *outFilePath,
size_t outFilePathCapacity,
UBool optWinDllExport);

#endif
111 changes: 111 additions & 0 deletions tools/icu/patches/75/source/tools/pkgdata/pkg_genc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2008-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/

#ifndef __PKG_GENC_H__
#define __PKG_GENC_H__

#include "unicode/utypes.h"
#include "toolutil.h"

#include "unicode/putil.h"
#include "putilimp.h"

/*** Platform #defines move here ***/
#if U_PLATFORM_HAS_WIN32_API
#ifdef __GNUC__
#define WINDOWS_WITH_GNUC
#else
#define WINDOWS_WITH_MSVC
#endif
#endif


#if !defined(WINDOWS_WITH_MSVC)
#define BUILD_DATA_WITHOUT_ASSEMBLY
#endif

#ifndef U_DISABLE_OBJ_CODE /* testing */
#if defined(WINDOWS_WITH_MSVC) || U_PLATFORM_IS_LINUX_BASED
#define CAN_WRITE_OBJ_CODE
#endif
#if U_PLATFORM_HAS_WIN32_API || defined(U_ELF)
#define CAN_GENERATE_OBJECTS
#endif
#endif

#if U_PLATFORM == U_PF_CYGWIN || defined(CYGWINMSVC)
#define USING_CYGWIN
#endif

/*
* When building the data library without assembly,
* some platforms use a single c code file for all of
* the data to generate the final data library. This can
* increase the performance of the pkdata tool.
*/
#if U_PLATFORM == U_PF_OS400
#define USE_SINGLE_CCODE_FILE
#endif

/* Need to fix the file seperator character when using MinGW. */
#if defined(WINDOWS_WITH_GNUC) || defined(USING_CYGWIN)
#define PKGDATA_FILE_SEP_STRING "/"
#else
#define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING
#endif

#define LARGE_BUFFER_MAX_SIZE 2048
#define SMALL_BUFFER_MAX_SIZE 512
#define SMALL_BUFFER_FLAG_NAMES 32
#define BUFFER_PADDING_SIZE 20

/** End platform defines **/



U_CAPI void U_EXPORT2
printAssemblyHeadersToStdErr(void);

U_CAPI UBool U_EXPORT2
checkAssemblyHeaderName(const char* optAssembly);

U_CAPI UBool U_EXPORT2
checkCpuArchitecture(const char* optCpuArch);

U_CAPI void U_EXPORT2
writeCCode(
const char *filename,
const char *destdir,
const char *optEntryPoint,
const char *optName,
const char *optFilename,
char *outFilePath,
size_t outFilePathCapacity);

U_CAPI void U_EXPORT2
writeAssemblyCode(
const char *filename,
const char *destdir,
const char *optEntryPoint,
const char *optFilename,
char *outFilePath,
size_t outFilePathCapacity);

U_CAPI void U_EXPORT2
writeObjectCode(
const char *filename,
const char *destdir,
const char *optEntryPoint,
const char *optMatchArch,
const char *optCpuArch,
const char *optFilename,
char *outFilePath,
size_t outFilePathCapacity,
UBool optWinDllExport);

#endif
Loading

0 comments on commit 06d34c4

Please sign in to comment.