From: Adam Dickmeiss Date: Thu, 8 Nov 2007 08:17:17 +0000 (+0000) Subject: For ICU enabled YAZ defined YAZ_HAVE_ICU instead of HAVE_ICU. X-Git-Tag: YAZ.3.0.16~30 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=479969ddd4d243955f2e64ef8571926429ad4f37 For ICU enabled YAZ defined YAZ_HAVE_ICU instead of HAVE_ICU. --- diff --git a/configure.ac b/configure.ac index 1170ef3..cc284c9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1995-2007 dnl See the file LICENSE for details. -dnl $Id: configure.ac,v 1.95 2007-10-22 12:21:38 adam Exp $ +dnl $Id: configure.ac,v 1.96 2007-11-08 08:17:17 adam Exp $ AC_PREREQ(2.59) AC_INIT([yaz],[3.0.15],[yaz-help@indexdata.dk]) AC_CONFIG_SRCDIR(configure.ac) @@ -314,10 +314,10 @@ dnl AC_SUBST(YAZ_CONFIG_CFLAGS) dnl dnl -AC_CHECK_ICU(3.6, [], - AC_MSG_WARN([For ICU internationalizing support please install libicu36-dev - or similar])) -dnl +AC_CHECK_ICU([3.6],[ + ICU_CPPFLAGS="$ICU_CPPFLAGS -D YAZ_HAVE_ICU=1"],[ + AC_MSG_WARN([For ICU support please install libicu36-dev or similar]) +]) dnl ------ GNU threads HAVETHREADS=0 AC_ARG_ENABLE(pth, [ --enable-pth enable GNU threads],[enable_pth=$enableval],[enable_pth=no]) diff --git a/src/icu_I18N.c b/src/icu_I18N.c index a978b21..2259b46 100644 --- a/src/icu_I18N.c +++ b/src/icu_I18N.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: icu_I18N.c,v 1.12 2007-11-07 10:19:12 adam Exp $ + * $Id: icu_I18N.c,v 1.13 2007-11-08 08:17:17 adam Exp $ */ #if HAVE_CONFIG_H @@ -15,7 +15,7 @@ #endif -#if HAVE_ICU +#if YAZ_HAVE_ICU #include #include @@ -1240,9 +1240,7 @@ const UCollator * icu_chain_get_coll(struct icu_chain * chain) } - - -#endif /* HAVE_ICU */ +#endif /* YAZ_HAVE_ICU */ diff --git a/test/tst_icu_I18N.c b/test/tst_icu_I18N.c index 1d6e205..cf328ad 100644 --- a/test/tst_icu_I18N.c +++ b/test/tst_icu_I18N.c @@ -1,4 +1,4 @@ -/* $Id: tst_icu_I18N.c,v 1.11 2007-10-29 13:50:57 marc Exp $ +/* $Id: tst_icu_I18N.c,v 1.12 2007-11-08 08:17:18 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -33,7 +33,7 @@ #include -#if HAVE_ICU +#if YAZ_HAVE_ICU #include #include @@ -514,7 +514,6 @@ void test_icu_I18N_chain(int argc, char **argv) YAZ_CHECK(icu_chain_assign_cstr(chain, en_str, &status)); - //printf("ICU chain:\ninput: '%s'\n", en_str); while (icu_chain_next_token(chain, &status)){ ; /* printf("%d '%s' '%s'\n", @@ -681,7 +680,7 @@ void test_chain_empty_chain(void) icu_chain_destroy(chain); } -#endif // HAVE_ICU +#endif /* YAZ_HAVE_ICU */ /* DO NOT EDIT THIS FILE IF YOUR EDITOR DOES NOT SUPPORT UTF-8 */ @@ -691,7 +690,7 @@ int main(int argc, char **argv) YAZ_CHECK_INIT(argc, argv); YAZ_CHECK_LOG(); -#if HAVE_ICU +#if YAZ_HAVE_ICU test_icu_I18N_casemap(argc, argv); test_icu_I18N_sortmap(argc, argv); @@ -702,13 +701,13 @@ int main(int argc, char **argv) test_chain_empty_chain(); test_bug_1140(); -#else /* HAVE_ICU */ +#else /* YAZ_HAVE_ICU */ printf("ICU unit tests omitted.\n" "Please install libicu36-dev and icu-doc or similar\n"); YAZ_CHECK(0 == 0); -#endif /* HAVE_ICU */ +#endif /* YAZ_HAVE_ICU */ YAZ_CHECK_TERM; } diff --git a/util/yaz-icu.c b/util/yaz-icu.c index dd97249..c6e7a0e 100644 --- a/util/yaz-icu.c +++ b/util/yaz-icu.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: yaz-icu.c,v 1.8 2007-11-07 09:50:24 adam Exp $ + * $Id: yaz-icu.c,v 1.9 2007-11-08 08:17:18 adam Exp $ */ #if HAVE_CONFIG_H @@ -17,7 +17,7 @@ #include -#if HAVE_ICU +#if YAZ_HAVE_ICU #include #include @@ -505,13 +505,13 @@ static void process_text_file(const struct config_t *p_config) free(line); } -#endif /* HAVE_ICU */ +#endif /* YAZ_HAVE_ICU */ int main(int argc, char **argv) { -#if HAVE_ICU +#if YAZ_HAVE_ICU read_params(argc, argv, &config); @@ -521,14 +521,14 @@ int main(int argc, char **argv) if (config.print && strlen(config.print)) print_info(&config); -#else /* HAVE_ICU */ +#else /* YAZ_HAVE_ICU */ printf("ICU not available on your system.\n" "Please install libicu36-dev and icu-doc or similar, " "re-configure and re-compile\n"); -#endif /* HAVE_ICU */ +#endif /* YAZ_HAVE_ICU */ return(0); }