Could someone please tell me what string_init is supposed to do, where
it _should_ look for the ICU data directory (if at all)?
...
build_path = data_dir = const_cast(DEFAULT_ICU_DATA_DIR);
/*
* if the installed --prefix directory exists then use it
*/
prefix = Parrot_get_runtime_prefix(interpreter, NULL);
if (prefix) {
p = strstr(build_path, "blib"); /* .../blib/lib/... */
assert(p);
--p; /* slash or backslash */
data_dir = mem_sys_allocate(strlen(prefix) + strlen(p) + 1);
strcpy(data_dir, prefix);
strcat(data_dir, p);
free_data_dir = 1;
}
...
Ron
Why is DEFAULT_ICU_DATA_DIR empty? Where is icu actually and which
config variable is pointing at it?
Is this happening with C<--prefix> set or not?
> Could someone please tell me what string_init is supposed to do, where
> it _should_ look for the ICU data directory (if at all)?
> ...
> build_path = data_dir = const_cast(DEFAULT_ICU_DATA_DIR);
> /*
> * if the installed --prefix directory exists then use it
> */
> prefix = Parrot_get_runtime_prefix(interpreter, NULL);
> if (prefix) {
> p = strstr(build_path, "blib"); /* .../blib/lib/... */
> assert(p);
If there are other cases (system ICU or whatever) they should be
included here instead of the assert.
> Ron
leo
> Why is DEFAULT_ICU_DATA_DIR empty? Where is icu actually and which
> config variable is pointing at it?
I've put the precompiled ICU into a directory, and supply the
--icushared and --icuheaders. This precompiled package contains only
the bin, include and lib. There's no data directory. This is because
the ICU built-in data gets compiled into binary form, the library is
named icudata.lib and icudt??.dll on Windows. If the data directory
is set to the empty string, the library is used.
"
The ICU data directory is determined as follows:
...
4. Otherwise, the ICU data directory is an empty string. This is the
default behavior for ICU using a shared library for its data and
provides the highest data loading performance.
...
The ICU data directory does not need to be set in order to reference
the standard built-in ICU data. Applications that just use standard
ICU capabilities (converters, locales, collation, etc.) but do not
build and reference their own data do not need to specify an ICU data
directory.
"
http://oss.software.ibm.com/icu/userguide/icudata.html
> Is this happening with C<--prefix> set or not?
No prefix, but it defaults to F</usr/local/parrot-0.1.1-devel>.
>> Could someone please tell me what string_init is supposed to do, where
>> it _should_ look for the ICU data directory (if at all)?
>> ...
>> build_path = data_dir = const_cast(DEFAULT_ICU_DATA_DIR);
>> /*
>> * if the installed --prefix directory exists then use it
>> */
>> prefix = Parrot_get_runtime_prefix(interpreter, NULL);
>> if (prefix) {
>> p = strstr(build_path, "blib"); /* .../blib/lib/... */
>> assert(p);
> If there are other cases (system ICU or whatever) they should be
> included here instead of the assert.
In my opinion, if only the built-in ICU data is used we should just
use the compiled library. If there are any modifications/extensions
(planned) I'll gladly provide a patch, including for F<README.win32>,
b/c C<--icudatadir> should be provided.
Ron
> I've put the precompiled ICU into a directory, and supply the
> --icushared and --icuheaders. This precompiled package contains only
> the bin, include and lib. There's no data directory. This is because
> the ICU built-in data gets compiled into binary form, the library is
> named icudata.lib and icudt??.dll on Windows. If the data directory
> is set to the empty string, the library is used.
Ok. I've now put in a test for an empty string. Hope that works.
leo
Thanks, parrot now runs, even if it is installed on Windows.
The install procedure needs some work, though, as a number of files is
not installed, eg parrot(.exe) and the dynclasses. But that's a
different story.
Ron