# copyright John Maddock 2003, Artyom Beilis 2010 # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt. project /boost/locale : source-location ../src ; import configure ; import os ; import toolset ; import project ; import feature ; # Features feature.feature boost.locale.iconv : on off : optional propagated ; feature.feature boost.locale.icu : on off : optional propagated ; feature.feature boost.locale.posix : on off : optional propagated ; feature.feature boost.locale.std : on off : optional propagated ; feature.feature boost.locale.winapi : on off : optional propagated ; # Configuration of libraries ## iconv obj has_iconv_libc_obj : ../build/has_iconv.cpp ; exe has_iconv : has_iconv_libc_obj ; explicit has_iconv ; ICONV_PATH = [ modules.peek : ICONV_PATH ] ; lib iconv : : $(ICONV_PATH)/lib shared shared : : $(ICONV_PATH)/include ; explicit iconv ; obj has_iconv_libc_ext : ../build/has_iconv.cpp iconv ; exe has_external_iconv : has_iconv_libc_ext iconv ; explicit has_external_iconv ; exe accepts_shared_option : ../build/option.cpp : -shared-libstdc++ -shared-libgcc -shared-libstdc++ -shared-libgcc ; ICU_PATH = [ modules.peek : ICU_PATH ] ; ICU_LINK = [ modules.peek : ICU_LINK ] ; if $(ICU_LINK) { ICU_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin shared ; ICU64_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin64 shared ; } else { searched-lib icuuc : : icuuc $(ICU_PATH)/lib shared shared ; searched-lib icuuc : : msvc debug icuucd $(ICU_PATH)/lib shared shared ; searched-lib icuuc : : this_is_an_invalid_library_name ; searched-lib icudt : : $(ICU_PATH)/lib icudata shared shared ; searched-lib icudt : : $(ICU_PATH)/lib icudt msvc shared shared ; searched-lib icudt : : this_is_an_invalid_library_name ; searched-lib icuin : : $(ICU_PATH)/lib icui18n shared shared ; searched-lib icuin : : msvc debug icuind $(ICU_PATH)/lib shared shared ; searched-lib icuin : : msvc release icuin $(ICU_PATH)/lib shared shared ; searched-lib icuin : : this_is_an_invalid_library_name ; explicit icuuc icudt icuin ; ICU_OPTS = $(ICU_PATH)/include icuuc/shared/shared icudt/shared/shared icuin/shared/shared $(ICU_PATH)/bin shared ; searched-lib icuuc_64 : : icuuc $(ICU_PATH)/lib64 shared shared ; searched-lib icuuc_64 : : msvc debug icuucd $(ICU_PATH)/lib64 shared shared ; searched-lib icuuc_64 : : this_is_an_invalid_library_name ; searched-lib icudt_64 : : $(ICU_PATH)/lib64 icudata shared shared ; searched-lib icudt_64 : : $(ICU_PATH)/lib64 icudt msvc shared shared ; searched-lib icudt_64 : : this_is_an_invalid_library_name ; searched-lib icuin_64 : : $(ICU_PATH)/lib64 icui18n shared shared ; searched-lib icuin_64 : : msvc debug icuind $(ICU_PATH)/lib64 shared shared ; searched-lib icuin_64 : : msvc release icuin $(ICU_PATH)/lib64 shared shared ; searched-lib icuin_64 : : this_is_an_invalid_library_name ; explicit icuuc_64 icudt_64 icuin_64 ; ICU64_OPTS = $(ICU_PATH)/include icuuc_64/shared/shared icudt_64/shared/shared icuin_64/shared/shared $(ICU_PATH)/bin64 shared ; } obj has_icu_obj : ../build/has_icu_test.cpp : $(ICU_OPTS) ; obj has_icu64_obj : ../build/has_icu_test.cpp : $(ICU64_OPTS) ; exe has_icu : has_icu_obj : $(ICU_OPTS) ; exe has_icu64 : has_icu64_obj : $(ICU64_OPTS) ; explicit has_icu has_icu64 ; # This function is called whenever the 'boost_locale' metatarget # below is generated and figures what external components we have, # what user wants, and what sources have to be compiled in the end. rule configure-full ( properties * : flags-only ) { local result ; local flags-result ; local found-iconv ; if on in $(properties) || ! in $(properties:G) && ! solaris in $(properties) { # See if iconv is bundled with standard library. if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] { found-iconv = true ; } else { if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] { found-iconv = true ; result += iconv ; } } } if $(found-iconv) { flags-result += BOOST_LOCALE_WITH_ICONV=1 ; } local found-icu ; if ! off in $(properties) { if [ configure.builds has_icu : $(properties) : "icu" ] { found-icu = true ; flags-result += BOOST_LOCALE_WITH_ICU=1 $(ICU_OPTS) ; } else if [ configure.builds has_icu64 : $(properties) : "icu (lib64)" ] { found-icu = true ; flags-result += BOOST_LOCALE_WITH_ICU=1 $(ICU64_OPTS) ; } if $(found-icu) { ICU_SOURCES = boundary codecvt collator conversion date_time formatter icu_backend numeric time_zone ; result += icu/$(ICU_SOURCES).cpp ../../thread/build//boost_thread ; } } if ! $(found-iconv) && ! $(found-icu) && ! windows in $(properties) && ! cygwin in $(properties) { ECHO "- Boost.Locale needs either iconv or ICU library to be built." ; result += no ; } if ! in $(properties:G) { if sun in $(properties) { properties += off ; } else { properties += on ; } } if off in $(properties) { flags-result += BOOST_LOCALE_NO_STD_BACKEND=1 ; } else { STD_SOURCES = codecvt collate converter numeric std_backend ; result += std/$(STD_SOURCES).cpp ; } if ! in $(properties:G) { if windows in $(properties) || cygwin in $(properties) { properties += on ; } else { properties += off ; } } if windows in $(properties) && gcc in $(properties) && shared in $(properties) && [ configure.builds accepts_shared_option : $(properties) : "g++ -shared-* supported" ] { flags-result += -shared-libstdc++ -shared-libgcc -shared-libstdc++ -shared-libgcc ; } if off in $(properties) { flags-result += BOOST_LOCALE_NO_WINAPI_BACKEND=1 ; } else { WINAPI_SOURCES = collate converter numeric win_backend ; result += win32/$(WINAPI_SOURCES).cpp ; } if ( ! off in $(properties) || ! off in $(properties) ) && ( windows in $(properties) || cygwin in $(properties) ) { result += win32/lcid.cpp ; } if ! in $(properties:G) { if linux in $(properties) || darwin in $(properties) { properties += on ; } else { properties += off ; } } if off in $(properties) { flags-result += BOOST_LOCALE_NO_POSIX_BACKEND=1 ; } else { POSIX_SOURCES = collate converter numeric codecvt posix_backend ; result += posix/$(POSIX_SOURCES).cpp ; } if on in $(properties) || on in $(properties) || on in $(properties) { result += util/gregorian.cpp ; } result += ../../system/build//boost_system ; if "$(flags-only)" = "flags" { return $(flags-result) ; } else { result += $(flags-result) ; return $(result) ; } } rule configure ( properties * ) { local result = [ configure-full $(properties) : "all" ] ; return $(result) ; } rule configure-flags ( properties * ) { local result ; result = [ configure-full $(properties) : "flags" ] ; return $(result) ; } alias build_options : : : : @configure ; alias build_flags : : : : @configure-flags ; lib boost_locale : encoding/codepage.cpp shared/date_time.cpp shared/format.cpp shared/formatting.cpp shared/generator.cpp shared/ids.cpp shared/localization_backend.cpp shared/message.cpp shared/mo_lambda.cpp util/codecvt_converter.cpp util/default_locale.cpp util/info.cpp util/locale_data.cpp : # Don't link explicitly, not required BOOST_THREAD_NO_LIB=1 shared:BOOST_LOCALE_DYN_LINK=1 multi # Meanwhile remove this @configure ; boost-install boost_locale ; # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4