Skip to content

ICU-22049 fix layoutex #2106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 81 additions & 13 deletions icu4c/source/configure
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
CPP
OTHER_ICUUC_LIBS
OTHER_ICUUC_CFLAGS
ICULEHB_LIBS
ICULEHB_CFLAGS
PKG_CONFIG_LIBDIR
Expand Down Expand Up @@ -757,7 +759,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -824,6 +825,8 @@ PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
ICULEHB_CFLAGS
ICULEHB_LIBS
OTHER_ICUUC_CFLAGS
OTHER_ICUUC_LIBS
CPP'


Expand Down Expand Up @@ -863,7 +866,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1116,15 +1118,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1262,7 +1255,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1415,7 +1408,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -1511,6 +1503,10 @@ Some influential environment variables:
C compiler flags for ICULEHB, overriding pkg-config
ICULEHB_LIBS
linker flags for ICULEHB, overriding pkg-config
OTHER_ICUUC_CFLAGS
C compiler flags for OTHER_ICUUC, overriding pkg-config
OTHER_ICUUC_LIBS
linker flags for OTHER_ICUUC, overriding pkg-config
CPP C preprocessor

Use these variables to override the choices made by `configure' or to help
Expand Down Expand Up @@ -3967,6 +3963,78 @@ else
$as_echo "yes" >&6; }
have_icu_le_hb=true
fi
# is there another ICUUC installed? For layoutex.

pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OTHER_ICUUC" >&5
$as_echo_n "checking for OTHER_ICUUC... " >&6; }

if test -n "$OTHER_ICUUC_CFLAGS"; then
pkg_cv_OTHER_ICUUC_CFLAGS="$OTHER_ICUUC_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc\""; } >&5
($PKG_CONFIG --exists --print-errors "icu-uc") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_OTHER_ICUUC_CFLAGS=`$PKG_CONFIG --cflags "icu-uc" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$OTHER_ICUUC_LIBS"; then
pkg_cv_OTHER_ICUUC_LIBS="$OTHER_ICUUC_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc\""; } >&5
($PKG_CONFIG --exists --print-errors "icu-uc") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_OTHER_ICUUC_LIBS=`$PKG_CONFIG --libs "icu-uc" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi



if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }

if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
OTHER_ICUUC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-uc" 2>&1`
else
OTHER_ICUUC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-uc" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$OTHER_ICUUC_PKG_ERRORS" >&5

:
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
:
else
OTHER_ICUUC_CFLAGS=$pkg_cv_OTHER_ICUUC_CFLAGS
OTHER_ICUUC_LIBS=$pkg_cv_OTHER_ICUUC_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
have_other_icu_uc=true
fi

# Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
# The release mode use is the default one for autoconf
Expand Down
4 changes: 3 additions & 1 deletion icu4c/source/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RC
# pkg-config is needed for harfbuzz support
PKG_PROG_PKG_CONFIG([0.20])
PKG_CHECK_MODULES(ICULEHB, icu-le-hb, have_icu_le_hb=true, :)
# is there another ICUUC installed? For layoutex.
PKG_CHECK_MODULES(OTHER_ICUUC, icu-uc, have_other_icu_uc=true, :)

# Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
# The release mode use is the default one for autoconf
Expand Down Expand Up @@ -661,7 +663,7 @@ sparc-*-solaris*)
ia64-*-hpux*)
# There has been some issues with building ICU data on HPUX ia64 aCC
# when using the assemble code setting below. For now, build without
# assemble code for this platform. This will increase the build time.
# assemble code for this platform. This will increase the build time.
# GENCCODE_ASSEMBLY="-a aCC-ia64"
;;
esac
Expand Down
20 changes: 16 additions & 4 deletions icu4c/source/icudefs.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@
# The ICU data external name is usually icudata; the entry point name is
# the version-dependent name (for no particular reason except it was easier
# to change the build this way). When building in common mode, the data
# name is the versioned platform-dependent one.
# name is the versioned platform-dependent one.

ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)

ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@
# the entry point is almost like the basename, but has the lib suffix.
ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@
# the entry point is almost like the basename, but has the lib suffix.
ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@
ICUDATA_CHAR = @ICUDATA_CHAR@
ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR)
PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
Expand Down Expand Up @@ -215,7 +215,7 @@ LIBICU = $(LIBPREFIX)$(ICUPREFIX)
ifneq ($(ENABLE_SHARED),YES)
STATIC_PREFIX_WHEN_USED = s
else
STATIC_PREFIX_WHEN_USED =
STATIC_PREFIX_WHEN_USED =
endif

# Static library prefix and file extension
Expand Down Expand Up @@ -273,6 +273,18 @@ ICULEHB_TRUE=#
ICULEHB_FALSE=
endif

OTHER_ICUUC_CFLAGS=@OTHER_ICUUC_CFLAGS@
OTHER_ICUUC_LIBS=@OTHER_ICUUC_LIBS@
ifneq ($(OTHER_ICUUC_CFLAGS),)
HAVE_OTHER_ICUUC=yes
OTHERICUUC_TRUE=
OTHERICUUC_FALSE=#
else
HAVE_OTHER_ICUUC=no
OTHERICUUC_TRUE=#
OTHERICUUC_FALSE=
endif

# Just the libs.
ICULIBS_DT = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
ICULIBS_UC = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
Expand Down
21 changes: 17 additions & 4 deletions icu4c/source/layoutex/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,29 @@ CXXFLAGS += $(LIBCXXFLAGS)


ifeq ($(USING_ICULEHB),no)
# cppflags: load .. so that #include <layout/...> works
ICULE_CFLAGS=-I$(srcdir)/..
error("ICULEHB is required, see build instructions")
else
ICULE_CFLAGS=$(ICULEHB_CFLAGS)
endif

CPPFLAGS += -I$(srcdir) -I$(srcdir)/unicode -I$(top_srcdir)/common $(ICULE_CFLAGS) $(LIBCPPFLAGS)
CPPFLAGS += -I$(srcdir)

ifeq ($(HAVE_OTHER_ICUUC),yes)
# use other installed ICU
CPPFLAGS += $(OTHER_ICUUC_CFLAGS) -ULE_USE_CMEMORY
LIBS += $(OTHER_ICUUC_LIBS)
DEFS += -DHAVE_OTHER_ICUUC
# Do not set U_LAYOUTEX_IMPLEMENTATION
else
# attempt to use 'this' ICU
CPPFLAGS += -I$(srcdir)/unicode -I$(top_srcdir)/common $(ICULE_CFLAGS)
DEFS += -DU_LAYOUTEX_IMPLEMENTATION
LIBS += $(LIBICUUC) $(DEFAULT_LIBS)
endif

CPPFLAGS += $(LIBCPPFLAGS) $(ICULE_CFLAGS)
LDFLAGS += $(LDFLAGSICULX)
LIBS = $(LIBICUUC) $(LIBICULE) $(DEFAULT_LIBS)
LIBS += $(ICULEHB_LIBS)

SOURCES = $(shell cat $(srcdir)/sources.txt)
OBJECTS = $(SOURCES:.cpp=.o)
Expand Down
8 changes: 8 additions & 0 deletions icu4c/source/layoutex/ParagraphLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@

U_NAMESPACE_BEGIN

#ifndef FALSE
#define FALSE false
#endif

#ifndef TRUE
#define TRUE true
#endif

Comment on lines +33 to +40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed after #2175

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])

/* Leave this copyright notice here! It needs to go somewhere in this library. */
Expand Down
9 changes: 9 additions & 0 deletions icu4c/source/layoutex/RunArrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@

U_NAMESPACE_BEGIN

#ifndef FALSE
#define FALSE false
#endif

#ifndef TRUE
#define TRUE true
#endif


Comment on lines +19 to +27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed after #2175

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

const char RunArray::fgClassID = 0;

RunArray::RunArray(le_int32 initialCapacity)
Expand Down
1 change: 1 addition & 0 deletions icu4c/source/layoutex/cmemory.h
1 change: 1 addition & 0 deletions icu4c/source/layoutex/cstring.h
1 change: 1 addition & 0 deletions icu4c/source/layoutex/uassert.h
1 change: 1 addition & 0 deletions icu4c/source/layoutex/usc_impl.h