Skip to content

Commit

Permalink
Bug 1284406 part 3 - Export ICU headers in include/unicode. r=glandium
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: FuwAgEGjhxm
  • Loading branch information
upsuper committed Jul 20, 2016
1 parent 7779dbf commit b5cac2b
Show file tree
Hide file tree
Showing 17 changed files with 195 additions and 41 deletions.
5 changes: 2 additions & 3 deletions build/autoconf/icu.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ MOZ_ARG_WITH_BOOL(system-icu,
if test -n "$MOZ_SYSTEM_ICU"; then
PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
else
MOZ_ICU_INCLUDES="/intl/icu/source/common /intl/icu/source/i18n"
CFLAGS="$CFLAGS $MOZ_ICU_CFLAGS"
CXXFLAGS="$CXXFLAGS $MOZ_ICU_CFLAGS"
fi
AC_SUBST_LIST(MOZ_ICU_INCLUDES)
AC_SUBST(MOZ_SYSTEM_ICU)
MOZ_ARG_WITH_STRING(intl-api,
Expand Down
2 changes: 1 addition & 1 deletion config/external/icu/common/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DEFINES['U_COMMON_IMPLEMENTATION'] = True
#FIXME: should probably stop including mozilla-config.h
DEFINES['LOCALE_SNAME'] = 0x5c

LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
LOCAL_INCLUDES += ['/intl/icu/source/i18n']

include('../defs.mozbuild')
include('sources.mozbuild')
89 changes: 89 additions & 0 deletions config/external/icu/common/sources.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,92 @@ SOURCES += [
'/intl/icu/source/common/uvectr64.cpp',
'/intl/icu/source/common/wintz.c',
]

EXPORTS.unicode += [
'/intl/icu/source/common/unicode/appendable.h',
'/intl/icu/source/common/unicode/brkiter.h',
'/intl/icu/source/common/unicode/bytestream.h',
'/intl/icu/source/common/unicode/bytestrie.h',
'/intl/icu/source/common/unicode/bytestriebuilder.h',
'/intl/icu/source/common/unicode/caniter.h',
'/intl/icu/source/common/unicode/chariter.h',
'/intl/icu/source/common/unicode/dbbi.h',
'/intl/icu/source/common/unicode/docmain.h',
'/intl/icu/source/common/unicode/dtintrv.h',
'/intl/icu/source/common/unicode/enumset.h',
'/intl/icu/source/common/unicode/errorcode.h',
'/intl/icu/source/common/unicode/filteredbrk.h',
'/intl/icu/source/common/unicode/icudataver.h',
'/intl/icu/source/common/unicode/icuplug.h',
'/intl/icu/source/common/unicode/idna.h',
'/intl/icu/source/common/unicode/listformatter.h',
'/intl/icu/source/common/unicode/localpointer.h',
'/intl/icu/source/common/unicode/locid.h',
'/intl/icu/source/common/unicode/messagepattern.h',
'/intl/icu/source/common/unicode/normalizer2.h',
'/intl/icu/source/common/unicode/normlzr.h',
'/intl/icu/source/common/unicode/parseerr.h',
'/intl/icu/source/common/unicode/parsepos.h',
'/intl/icu/source/common/unicode/platform.h',
'/intl/icu/source/common/unicode/ptypes.h',
'/intl/icu/source/common/unicode/putil.h',
'/intl/icu/source/common/unicode/rbbi.h',
'/intl/icu/source/common/unicode/rep.h',
'/intl/icu/source/common/unicode/resbund.h',
'/intl/icu/source/common/unicode/schriter.h',
'/intl/icu/source/common/unicode/std_string.h',
'/intl/icu/source/common/unicode/strenum.h',
'/intl/icu/source/common/unicode/stringpiece.h',
'/intl/icu/source/common/unicode/stringtriebuilder.h',
'/intl/icu/source/common/unicode/symtable.h',
'/intl/icu/source/common/unicode/ubidi.h',
'/intl/icu/source/common/unicode/ubrk.h',
'/intl/icu/source/common/unicode/ucasemap.h',
'/intl/icu/source/common/unicode/ucat.h',
'/intl/icu/source/common/unicode/uchar.h',
'/intl/icu/source/common/unicode/ucharstrie.h',
'/intl/icu/source/common/unicode/ucharstriebuilder.h',
'/intl/icu/source/common/unicode/uchriter.h',
'/intl/icu/source/common/unicode/uclean.h',
'/intl/icu/source/common/unicode/ucnv.h',
'/intl/icu/source/common/unicode/ucnv_cb.h',
'/intl/icu/source/common/unicode/ucnv_err.h',
'/intl/icu/source/common/unicode/ucnvsel.h',
'/intl/icu/source/common/unicode/uconfig.h',
'/intl/icu/source/common/unicode/udata.h',
'/intl/icu/source/common/unicode/uenum.h',
'/intl/icu/source/common/unicode/uidna.h',
'/intl/icu/source/common/unicode/uiter.h',
'/intl/icu/source/common/unicode/ulistformatter.h',
'/intl/icu/source/common/unicode/uloc.h',
'/intl/icu/source/common/unicode/umachine.h',
'/intl/icu/source/common/unicode/umisc.h',
'/intl/icu/source/common/unicode/unifilt.h',
'/intl/icu/source/common/unicode/unifunct.h',
'/intl/icu/source/common/unicode/unimatch.h',
'/intl/icu/source/common/unicode/uniset.h',
'/intl/icu/source/common/unicode/unistr.h',
'/intl/icu/source/common/unicode/unorm.h',
'/intl/icu/source/common/unicode/unorm2.h',
'/intl/icu/source/common/unicode/uobject.h',
'/intl/icu/source/common/unicode/urename.h',
'/intl/icu/source/common/unicode/urep.h',
'/intl/icu/source/common/unicode/ures.h',
'/intl/icu/source/common/unicode/uscript.h',
'/intl/icu/source/common/unicode/uset.h',
'/intl/icu/source/common/unicode/usetiter.h',
'/intl/icu/source/common/unicode/ushape.h',
'/intl/icu/source/common/unicode/usprep.h',
'/intl/icu/source/common/unicode/ustring.h',
'/intl/icu/source/common/unicode/ustringtrie.h',
'/intl/icu/source/common/unicode/utext.h',
'/intl/icu/source/common/unicode/utf.h',
'/intl/icu/source/common/unicode/utf16.h',
'/intl/icu/source/common/unicode/utf32.h',
'/intl/icu/source/common/unicode/utf8.h',
'/intl/icu/source/common/unicode/utf_old.h',
'/intl/icu/source/common/unicode/utrace.h',
'/intl/icu/source/common/unicode/utypes.h',
'/intl/icu/source/common/unicode/uvernum.h',
'/intl/icu/source/common/unicode/uversion.h',
]
2 changes: 1 addition & 1 deletion config/external/icu/i18n/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FINAL_LIBRARY = 'icu'

DEFINES['U_I18N_IMPLEMENTATION'] = True

LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
LOCAL_INCLUDES += ['/intl/icu/source/common']

include('../defs.mozbuild')
include('sources.mozbuild')
84 changes: 84 additions & 0 deletions config/external/icu/i18n/sources.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,87 @@ SOURCES += [
'/intl/icu/source/i18n/zrule.cpp',
'/intl/icu/source/i18n/ztrans.cpp',
]

EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/alphaindex.h',
'/intl/icu/source/i18n/unicode/basictz.h',
'/intl/icu/source/i18n/unicode/calendar.h',
'/intl/icu/source/i18n/unicode/choicfmt.h',
'/intl/icu/source/i18n/unicode/coleitr.h',
'/intl/icu/source/i18n/unicode/coll.h',
'/intl/icu/source/i18n/unicode/compactdecimalformat.h',
'/intl/icu/source/i18n/unicode/curramt.h',
'/intl/icu/source/i18n/unicode/currpinf.h',
'/intl/icu/source/i18n/unicode/currunit.h',
'/intl/icu/source/i18n/unicode/datefmt.h',
'/intl/icu/source/i18n/unicode/dcfmtsym.h',
'/intl/icu/source/i18n/unicode/decimfmt.h',
'/intl/icu/source/i18n/unicode/dtfmtsym.h',
'/intl/icu/source/i18n/unicode/dtitvfmt.h',
'/intl/icu/source/i18n/unicode/dtitvinf.h',
'/intl/icu/source/i18n/unicode/dtptngen.h',
'/intl/icu/source/i18n/unicode/dtrule.h',
'/intl/icu/source/i18n/unicode/fieldpos.h',
'/intl/icu/source/i18n/unicode/fmtable.h',
'/intl/icu/source/i18n/unicode/format.h',
'/intl/icu/source/i18n/unicode/fpositer.h',
'/intl/icu/source/i18n/unicode/gender.h',
'/intl/icu/source/i18n/unicode/gregocal.h',
'/intl/icu/source/i18n/unicode/locdspnm.h',
'/intl/icu/source/i18n/unicode/measfmt.h',
'/intl/icu/source/i18n/unicode/measunit.h',
'/intl/icu/source/i18n/unicode/measure.h',
'/intl/icu/source/i18n/unicode/msgfmt.h',
'/intl/icu/source/i18n/unicode/numfmt.h',
'/intl/icu/source/i18n/unicode/numsys.h',
'/intl/icu/source/i18n/unicode/plurfmt.h',
'/intl/icu/source/i18n/unicode/plurrule.h',
'/intl/icu/source/i18n/unicode/rbnf.h',
'/intl/icu/source/i18n/unicode/rbtz.h',
'/intl/icu/source/i18n/unicode/regex.h',
'/intl/icu/source/i18n/unicode/region.h',
'/intl/icu/source/i18n/unicode/reldatefmt.h',
'/intl/icu/source/i18n/unicode/scientificnumberformatter.h',
'/intl/icu/source/i18n/unicode/search.h',
'/intl/icu/source/i18n/unicode/selfmt.h',
'/intl/icu/source/i18n/unicode/simpletz.h',
'/intl/icu/source/i18n/unicode/smpdtfmt.h',
'/intl/icu/source/i18n/unicode/sortkey.h',
'/intl/icu/source/i18n/unicode/stsearch.h',
'/intl/icu/source/i18n/unicode/tblcoll.h',
'/intl/icu/source/i18n/unicode/timezone.h',
'/intl/icu/source/i18n/unicode/tmunit.h',
'/intl/icu/source/i18n/unicode/tmutamt.h',
'/intl/icu/source/i18n/unicode/tmutfmt.h',
'/intl/icu/source/i18n/unicode/translit.h',
'/intl/icu/source/i18n/unicode/tzfmt.h',
'/intl/icu/source/i18n/unicode/tznames.h',
'/intl/icu/source/i18n/unicode/tzrule.h',
'/intl/icu/source/i18n/unicode/tztrans.h',
'/intl/icu/source/i18n/unicode/ucal.h',
'/intl/icu/source/i18n/unicode/ucol.h',
'/intl/icu/source/i18n/unicode/ucoleitr.h',
'/intl/icu/source/i18n/unicode/ucsdet.h',
'/intl/icu/source/i18n/unicode/ucurr.h',
'/intl/icu/source/i18n/unicode/udat.h',
'/intl/icu/source/i18n/unicode/udateintervalformat.h',
'/intl/icu/source/i18n/unicode/udatpg.h',
'/intl/icu/source/i18n/unicode/udisplaycontext.h',
'/intl/icu/source/i18n/unicode/ufieldpositer.h',
'/intl/icu/source/i18n/unicode/uformattable.h',
'/intl/icu/source/i18n/unicode/ugender.h',
'/intl/icu/source/i18n/unicode/uldnames.h',
'/intl/icu/source/i18n/unicode/ulocdata.h',
'/intl/icu/source/i18n/unicode/umsg.h',
'/intl/icu/source/i18n/unicode/unirepl.h',
'/intl/icu/source/i18n/unicode/unum.h',
'/intl/icu/source/i18n/unicode/unumsys.h',
'/intl/icu/source/i18n/unicode/upluralrules.h',
'/intl/icu/source/i18n/unicode/uregex.h',
'/intl/icu/source/i18n/unicode/uregion.h',
'/intl/icu/source/i18n/unicode/usearch.h',
'/intl/icu/source/i18n/unicode/uspoof.h',
'/intl/icu/source/i18n/unicode/utmscale.h',
'/intl/icu/source/i18n/unicode/utrans.h',
'/intl/icu/source/i18n/unicode/vtzone.h',
]
2 changes: 0 additions & 2 deletions config/external/icu/stubdata/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

Library('icustubdata')

LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']

SOURCES += ['/intl/icu/source/stubdata/stubdata.c']
4 changes: 0 additions & 4 deletions dom/indexedDB/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,3 @@ LOCAL_INCLUDES += [
'/xpcom/build',
'/xpcom/threads',
]

if CONFIG['ENABLE_INTL_API']:
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
3 changes: 0 additions & 3 deletions gfx/thebes/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
# We prefer to use ICU for normalization functions, but currently it is only
# available if we're building with the Intl API enabled:
if CONFIG['ENABLE_INTL_API']:
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
USE_LIBS += [
'icu',
]
Expand Down
2 changes: 0 additions & 2 deletions intl/build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ SOURCES += [
]

FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
LOCAL_INCLUDES += [
'../locale',
'../lwbrk',
Expand Down
22 changes: 18 additions & 4 deletions intl/icu_sources_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,40 @@ def get_sources_from_makefile(makefile):
key=lambda x: x.lower())


def write_sources(mozbuild, sources):
def list_headers(path):
result = []
for name in os.listdir(path):
f = mozpath.join(path, name)
if os.path.isfile(f):
result.append(f)
return sorted(result, key=lambda x: x.lower())


def write_sources(mozbuild, sources, headers):
with open(mozbuild, 'wb') as f:
f.write('# THIS FILE IS GENERATED BY /intl/icu_sources_data.py ' +
'DO NOT EDIT\n' +
'SOURCES += [\n')
f.write(''.join(" '/%s',\n" % s for s in sources))
f.write(']\n\n')
f.write('EXPORTS.unicode += [\n')
f.write(''.join(" '/%s',\n" % s for s in headers))
f.write(']\n')


def update_sources(topsrcdir):
print('Updating ICU sources lists...')
sys.path.append(mozpath.join(topsrcdir, 'build/pymake'))
for d in ['common', 'i18n']:
makefile = mozpath.join(topsrcdir,
'intl/icu/source/%s/Makefile.in' % d)
base_path = mozpath.join(topsrcdir, 'intl/icu/source/%s' % d)
makefile = mozpath.join(base_path, 'Makefile.in')
mozbuild = mozpath.join(topsrcdir,
'config/external/icu/%s/sources.mozbuild' % d)
sources = [mozpath.relpath(s, topsrcdir)
for s in get_sources_from_makefile(makefile)]
write_sources(mozbuild, sources)
headers = [mozpath.normsep(os.path.relpath(s, topsrcdir))
for s in list_headers(mozpath.join(base_path, 'unicode'))]
write_sources(mozbuild, sources, headers)


def try_run(name, command, cwd=None, **kwargs):
Expand Down
2 changes: 0 additions & 2 deletions intl/locale/mac/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ UNIFIED_SOURCES += [
]

FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
LOCAL_INCLUDES += [
'..',
]
4 changes: 0 additions & 4 deletions intl/unicharutil/util/internal/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ LOCAL_INCLUDES += [
'..',
]

if CONFIG['ENABLE_INTL_API']:
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']

DIST_INSTALL = True
2 changes: 0 additions & 2 deletions intl/unicharutil/util/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ if CONFIG['_MSC_VER']:
CXXFLAGS += ['-Zl']

if CONFIG['ENABLE_INTL_API']:
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
USE_LIBS += ['icu']

DIST_INSTALL = True
1 change: 0 additions & 1 deletion js/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ OS_LIBS += CONFIG['REALTIME_LIBS']

CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']

NO_EXPAND_LIBS = True

Expand Down
6 changes: 0 additions & 6 deletions layout/forms/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,5 @@ LOCAL_INCLUDES += [
'/dom/html',
]

if CONFIG['ENABLE_INTL_API']:
# nsNumberControlFrame.cpp requires ICUUtils.h which in turn requires
# i18n/unum.h
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']

if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']
3 changes: 0 additions & 3 deletions netwerk/dns/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ LOCAL_INCLUDES += [

if CONFIG['ENABLE_INTL_API']:
DEFINES['IDNA2008'] = True
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
USE_LIBS += ['icu']
else:
UNIFIED_SOURCES += [
Expand Down
3 changes: 0 additions & 3 deletions xpcom/build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,3 @@ if CONFIG['MOZ_VPX']:

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
CXXFLAGS += CONFIG['TK_CFLAGS']

CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']

0 comments on commit b5cac2b

Please sign in to comment.