1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973
|
dnl -*-m4-*-
dnl configure.in for ICU
dnl Copyright (c) 1999-2003, International Business Machines Corporation and
dnl others. All Rights Reserved.
dnl Stephen F. Booth, heavily modified by Yves and others
dnl $Id: configure.in,v 1.203 2003/12/14 18:06:32 grhoten-oss Exp $
dnl Process this file with autoconf to produce a configure script
AC_INIT(common/unicode/utypes.h)
AC_CONFIG_HEADER(common/icucfg.h)
PACKAGE="icu"
AC_SUBST(PACKAGE)
AC_MSG_CHECKING(for ICU version numbers)
dnl Get the ICU version from uversion.h or other headers
geticuversion() {
[sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
}
VERSION=`geticuversion $srcdir/common/unicode/uversion.h`
if test x"$VERSION" = x; then
VERSION=`geticuversion $srcdir/common/unicode/*.h`
if test x"$VERSION" = x; then
AC_MSG_ERROR([Cannot determine ICU version number from header files])
fi
fi
dnl Compute a reasonable library version from the release version. This is
dnl very bad, but that's wanted... We want to make sure that the LIB_VERSION
dnl has at least a dot in it, so we'll add a .0 if needed.
[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
AC_SUBST(VERSION)
AC_SUBST(LIB_VERSION)
AC_SUBST(LIB_VERSION_MAJOR)
AC_MSG_RESULT([release $VERSION, library $LIB_VERSION])
UNICODE_VERSION="4"
AC_SUBST(UNICODE_VERSION)
AC_SUBST(CPPFLAGS)
dnl Checks for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
# make sure install is relative to srcdir - if a script
if test "$srcdir" = "."; then
# If srcdir isn't just ., then (srcdir) is already prepended.
if test "${ac_install_sh}" = "${INSTALL}"; then
INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
fi
fi
AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
AC_CHECK_PROG(STRIP, strip, strip, true)
dnl Check for the platform make
AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
AC_SUBST(U_MAKE)
dnl Check for doxygen to generate documentation
AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
dnl Determine the host system and Makefile fragment
AC_CANONICAL_HOST
AC_EXEEXT
dnl Determine how strict we want to be when compiling
AC_CHECK_STRICT_COMPILE
dnl Check if we can build and use 64-bit libraries
AC_CHECK_64BIT_LIBS
AC_SUBST(ARFLAGS)
AC_SUBST(COMPILE_LINK_ENVVAR)
ICU_CHECK_MH_FRAG
dnl Checks for libraries and other host specific stuff
dnl On HP/UX, don't link to -lm from a shared lib because it isn't
dnl PIC (at least on 10.2)
case "${host}" in
*-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
*) AC_CHECK_LIB(m, floor)
LIB_M="" ;;
esac
AC_SUBST(LIB_M)
dnl Check whether to build shared libraries
AC_MSG_CHECKING([whether to build shared libraries])
enabled=no
AC_ARG_ENABLE(shared,
[ --enable-shared build shared libraries [default=yes]],
[ case "${enableval}" in
yes|"") enabled=yes; ENABLE_SHARED=YES ;;
no);;
*) ;;
esac],
[enabled=yes; ENABLE_SHARED=YES]
)
AC_MSG_RESULT($enabled)
AC_SUBST(ENABLE_SHARED)
dnl Check whether to build static libraries
AC_MSG_CHECKING([whether to build static libraries])
enabled=no
AC_ARG_ENABLE(static,
[ --enable-static build static libraries [default=no]],
[ case "${enableval}" in
yes|"") enabled=yes; ENABLE_STATIC=YES ;;
no) ;;
*) ;;
esac],
)
AC_MSG_RESULT($enabled)
AC_SUBST(ENABLE_STATIC)
dnl Check whether to build debug libraries
AC_MSG_CHECKING([whether to build debug libraries])
enabled=no
ENABLE_DEBUG=0
AC_ARG_ENABLE(debug,
[ --enable-debug build debug libraries [default=no]],
[ case "${enableval}" in
yes|"") enabled=yes; ENABLE_DEBUG=1 ;;
*) ;;
esac],
)
AC_MSG_RESULT($enabled)
AC_SUBST(ENABLE_DEBUG)
dnl Check whether to build release libraries
AC_MSG_CHECKING([whether to build release libraries])
enabled=yes
ENABLE_RELEASE=1
AC_ARG_ENABLE(release,
[ --enable-release build release libraries [default=yes]],
[ case "${enableval}" in
no) enabled=no; ENABLE_RELEASE=0 ;;
*) ;;
esac],
)
AC_MSG_RESULT($enabled)
AC_SUBST(ENABLE_RELEASE)
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar,[echo archiver ar not found re-run configure ; false],$PATH:/bin:/usr/bin:/usr/ccs/bin)
AC_MSG_CHECKING([whether to enable renaming of symbols])
enabled=yes
U_DISABLE_RENAMING=0
AC_ARG_ENABLE(renaming,
[ --enable-renaming add a version suffix to symbols [default=yes]],
[ case "${enableval}" in
yes|"") enabled=yes ;;
no) enabled=no; U_DISABLE_RENAMING=1 ;;
*) ;;
esac],
)
AC_MSG_RESULT($enabled)
AC_SUBST(U_DISABLE_RENAMING)
AC_MSG_CHECKING([whether to enable function and data tracing])
enabled=yes
U_ENABLE_TRACING=1
AC_ARG_ENABLE(tracing,
[ --enable-tracing enable function and data tracing [default=yes]],
[ case "${enableval}" in
yes|"") enabled=yes ;;
no) enabled=no; U_ENABLE_TRACING=0 ;;
*) ;;
esac],
)
AC_MSG_RESULT($enabled)
AC_SUBST(U_ENABLE_TRACING)
dnl Check whether to use the evil rpath or not
AC_ARG_ENABLE(rpath,
[ --enable-rpath use rpath when linking [default is only if necessary]],
[ case "${enableval}" in
yes|"") ENABLE_RPATH=YES ;;
no) ;;
*) ;;
esac],
[ENABLE_RPATH=NO]
)
AC_SUBST(ENABLE_RPATH)
dnl set up U_INLINE.
dnl Copy the definition of AC_C_INLINE, with slight mods.
dnl
AC_CACHE_CHECK([for definition of U_INLINE for C], ac_cv_c_inline,
[ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break])
done
])
case "$ac_cv_c_inline" in
yes) U_INLINE= "inline" ;;
no ) U_INLINE= ;;
*) U_INLINE=$ac_cv_c_inline ;;
esac
AC_SUBST(U_INLINE)
threads=true
dnl Enable/disable threads
AC_ARG_ENABLE(threads,
[ --enable-threads build ICU with thread safety [default=yes]],
[case "${enableval}" in
yes) threads=true ;;
no) threads=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-threads) ;;
esac],
threads=true)
ICU_CONDITIONAL(THREADS, test "$threads" = true)
ICU_USE_THREADS=0
if test $threads = true; then
dnl For Compaq Tru64 (OSF1), we must look for pthread_attr_init
dnl and must do this before seaching for pthread_mutex_destroy, or
dnl we will pick up libpthreads.so not libpthread.so
dnl If this fails, then we must test for HPUX specials, before
dnl moving on to a more generic test
AC_CHECK_LIB(pthread, pthread_attr_init)
if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
ICU_USE_THREADS=1
else
dnl Locate the right library for POSIX threads. We look for the
dnl symbols in the libraries first, because on Solaris libc provides
dnl pthread_create but libpthread has the real code :(
dnl AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
dnl FreeBSD users may need libpthread if they do not have libc_r.
AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
if test "$ac_cv_search_pthread_mutex_destroy" != no; then
ICU_USE_THREADS=1
else
dnl For HP 11
AC_CHECK_LIB(pthread, pthread_mutex_init)
if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
ICU_USE_THREADS=1
fi
fi
AC_CHECK_FUNC(pthread_mutex_lock)
if test $ac_cv_func_pthread_mutex_lock = yes; then
ICU_USE_THREADS=1
fi
dnl Check to see if we are using CygWin with MSVC
case "${host}" in
*-pc-cygwin*|*-pc-mingw*)
if test "$ac_cv_prog_gcc" = no; then
dnl We're using normal windows compilers. Threading is available.
ICU_USE_THREADS=1
fi ;;
esac
fi
fi
AC_SUBST(ICU_USE_THREADS)
dnl Check for mmap()
# The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
# Do this check instead.
HAVE_MMAP=0
AC_MSG_CHECKING([for mmap])
AC_CACHE_VAL(ac_cv_func_mmap_ok,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
>>,
changequote([, ])dnl
[mmap((void *)0, 0, PROT_READ, 0, 0, 0);],
ac_cv_func_mmap_ok=yes,
ac_cv_func_mmap_ok=no)] )
AC_MSG_RESULT($ac_cv_func_mmap_ok)
if test $ac_cv_func_mmap_ok = yes
then
HAVE_MMAP=1
fi
AC_SUBST(HAVE_MMAP)
dnl Checks for header files
AC_CHECK_HEADERS(inttypes.h)
if test $ac_cv_header_inttypes_h = no; then
U_HAVE_INTTYPES_H=0
else
U_HAVE_INTTYPES_H=1
fi
if test "$CC" = ccc; then
AC_MSG_RESULT("C compiler set to CCC ${CC}" )
case "${host}" in
alpha*-*-*) U_HAVE_INTTYPES_H=0;
esac
fi
AC_SUBST(U_HAVE_INTTYPES_H)
AC_ARG_WITH(iostream,
[ --with-iostream=version specify the version of iostream to use (none, old, std, auto) [default=auto]],
[case "${withval}" in
none) streams=none ;;
old) streams=198506 ;;
std) streams=199711 ;;
auto) streams= ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
esac],
[streams=])
U_IOSTREAM_SOURCE=0
if test x$streams != xnone
then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([iostream usability])
AC_TRY_COMPILE([#include <iostream>],[],
[ac_cv_header_iostream=yes],[ac_cv_header_iostream=no])
AC_MSG_RESULT($ac_cv_header_iostream)
if test $ac_cv_header_iostream = yes
then
U_IOSTREAM_SOURCE=199711
else
AC_CHECK_HEADER(iostream.h)
if test $ac_cv_header_iostream_h = yes; then
AC_MSG_CHECKING([whether ostream is really defined])
AC_CACHE_VAL(ac_cv_iostream_ok,
AC_TRY_LINK([#include <iostream.h>],[ostream &testout = cout; testout << "test" << endl;],ac_cv_iostream_ok=yes,ac_cv_iostream_ok=no))
AC_MSG_RESULT($ac_cv_iostream_ok)
if test $ac_cv_iostream_ok = yes
then
U_IOSTREAM_SOURCE=198506
fi
fi
fi
if test x$streams != x
then
if test $U_IOSTREAM_SOURCE -ge $streams
then
U_IOSTREAM_SOURCE=$streams
else
AC_MSG_ERROR(${withval} iostream is not available)
fi
fi
fi
AC_SUBST(U_IOSTREAM_SOURCE)
AC_LANG_RESTORE
dnl Check for endianness
AC_C_BIGENDIAN()
if test $ac_cv_c_bigendian = no; then
U_IS_BIG_ENDIAN=0
U_ENDIAN_CHAR="l"
else
U_IS_BIG_ENDIAN=1
U_ENDIAN_CHAR="b"
fi
AC_SUBST(U_IS_BIG_ENDIAN)
dnl Do various POSIX related checks
U_HAVE_NL_LANGINFO_CODESET=0
U_NL_LANGINFO_CODESET=-1
AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
AC_SUBST(U_HAVE_NL_LANGINFO)
if test $U_HAVE_NL_LANGINFO -eq 1; then
AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
ac_cv_nl_langinfo_codeset,
[ac_cv_nl_langinfo_codeset="unknown"
for a in CODESET _NL_CTYPE_CODESET_NAME; do
AC_TRY_LINK([#include <langinfo.h>],[nl_langinfo($a);],[ac_cv_nl_langinfo_codeset="$a"; break])]
done)
if test x$ac_cv_nl_langinfo_codeset != xunknown
then
U_HAVE_NL_LANGINFO_CODESET=1
U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
fi
fi
AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
AC_SUBST(U_NL_LANGINFO_CODESET)
dnl Namespace support checks
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([for namespace support])
AC_CACHE_VAL(ac_cv_namespace_ok,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<namespace x_version {void f(){}};
namespace x = x_version;
using namespace x_version;
>>,
changequote([, ])dnl
[f();], ac_cv_namespace_ok=yes, ac_cv_namespace_ok=no)] )
AC_MSG_RESULT($ac_cv_namespace_ok)
U_HAVE_NAMESPACE=1
if test $ac_cv_namespace_ok = no
then
U_HAVE_NAMESPACE=0
fi
AC_SUBST(U_HAVE_NAMESPACE)
AC_MSG_CHECKING([for properly overriding new and delete])
U_OVERRIDE_CXX_ALLOCATION=0
U_HAVE_PLACEMENT_NEW=0
AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <stdlib.h>
class UObject {
void *operator new(size_t size) {return malloc(size);}
void *operator new[](size_t size) {return malloc(size);}
void operator delete(void *p) {free(p);}
void operator delete[](void *p) {free(p);}
};
>>,
changequote([, ])dnl
[], ac_cv_override_cxx_allocation_ok=yes, ac_cv_override_cxx_allocation_ok=no)] )
AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
if test $ac_cv_override_cxx_allocation_ok = yes
then
U_OVERRIDE_CXX_ALLOCATION=1
AC_MSG_CHECKING([for placement new and delete])
AC_CACHE_VAL(ac_cv_override_placement_new_ok,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <stdlib.h>
class UObject {
void *operator new(size_t size) {return malloc(size);}
void *operator new[](size_t size) {return malloc(size);}
void operator delete(void *p) {free(p);}
void operator delete[](void *p) {free(p);}
void * operator new(size_t, void *ptr) { return ptr; }
void operator delete(void *, void *) {}
};
>>,
changequote([, ])dnl
[], ac_cv_override_placement_new_ok=yes, ac_cv_override_placement_new_ok=no)] )
AC_MSG_RESULT($ac_cv_override_placement_new_ok)
if test $ac_cv_override_placement_new_ok = yes
then
U_HAVE_PLACEMENT_NEW=1
fi
fi
AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
AC_SUBST(U_HAVE_PLACEMENT_NEW)
AC_LANG_C
AC_CHECK_FUNC(popen)
if test x$ac_cv_func_popen = xyes
then
U_HAVE_POPEN=1
else
U_HAVE_POPEN=0
fi
AC_SUBST(U_HAVE_POPEN)
AC_CHECK_FUNC(tzset)
if test x$ac_cv_func_tzset = xyes
then
U_TZSET=tzset
else
AC_CHECK_FUNC(_tzset)
if test x$ac_cv_func__tzset = xyes
then
U_TZSET=_tzset
fi
fi
AC_SUBST(U_TZSET)
AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#ifndef __USE_POSIX
#define __USE_POSIX
#endif
#include <time.h>
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif>>,
changequote([, ])dnl
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
if test $ac_cv_var_tzname = yes; then
U_TZNAME=tzname
else
AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <time.h>
extern char *_tzname[];
>>,
changequote([, ])dnl
[atoi(*_tzname);], ac_cv_var__tzname=yes, ac_cv_var__tzname=no)])
if test $ac_cv_var__tzname = yes; then
U_TZNAME=_tzname
fi
fi
AC_SUBST(U_TZNAME)
AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#ifndef __USE_POSIX
#define __USE_POSIX
#endif
#ifndef __USE_XOPEN
#define __USE_XOPEN
#endif
#include <time.h>
>>,
changequote([, ])dnl
[timezone = 1;], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)])
U_HAVE_TIMEZONE=0
if test $ac_cv_var_timezone = yes; then
U_TIMEZONE=timezone
U_HAVE_TIMEZONE=1
else
AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <time.h>
>>,
changequote([, ])dnl
[__timezone = 1;], ac_cv_var___timezone=yes, ac_cv_var___timezone=no)])
if test $ac_cv_var___timezone = yes; then
U_TIMEZONE=__timezone
U_HAVE_TIMEZONE=1
else
AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <time.h>
>>,
changequote([, ])dnl
[_timezone = 1;], ac_cv_var__timezone=yes, ac_cv_var__timezone=no)])
if test $ac_cv_var__timezone = yes; then
U_TIMEZONE=_timezone
U_HAVE_TIMEZONE=1
fi
fi
fi
AC_SUBST(U_HAVE_TIMEZONE)
AC_SUBST(U_TIMEZONE)
dnl Checks for typedefs
AC_CHECK_TYPE(int8_t,signed char)
AC_CHECK_TYPE(uint8_t,unsigned char)
AC_CHECK_TYPE(int16_t,signed short)
AC_CHECK_TYPE(uint16_t,unsigned short)
AC_CHECK_TYPE(int32_t,signed long)
AC_CHECK_TYPE(uint32_t,unsigned long)
AC_CHECK_TYPE(int64_t,signed long long)
AC_CHECK_TYPE(uint64_t,unsigned long long)
if test $ac_cv_type_int8_t = no; then
HAVE_INT8_T=0
else
HAVE_INT8_T=1
fi
AC_SUBST(HAVE_INT8_T)
if test $ac_cv_type_uint8_t = no; then
HAVE_UINT8_T=0
else
HAVE_UINT8_T=1
fi
AC_SUBST(HAVE_UINT8_T)
if test $ac_cv_type_int16_t = no; then
HAVE_INT16_T=0
else
HAVE_INT16_T=1
fi
AC_SUBST(HAVE_INT16_T)
if test $ac_cv_type_uint16_t = no; then
HAVE_UINT16_T=0
else
HAVE_UINT16_T=1
fi
AC_SUBST(HAVE_UINT16_T)
if test $ac_cv_type_int32_t = no; then
HAVE_INT32_T=0
else
HAVE_INT32_T=1
fi
AC_SUBST(HAVE_INT32_T)
if test $ac_cv_type_uint32_t = no; then
HAVE_UINT32_T=0
else
HAVE_UINT32_T=1
fi
AC_SUBST(HAVE_UINT32_T)
if test $ac_cv_type_int64_t = no; then
HAVE_INT64_T=0
else
HAVE_INT64_T=1
fi
AC_SUBST(HAVE_INT64_T)
if test $ac_cv_type_uint64_t = no; then
HAVE_UINT64_T=0
else
HAVE_UINT64_T=1
fi
AC_SUBST(HAVE_UINT64_T)
dnl Do various wchar_t related checks
AC_CHECK_HEADER(wchar.h)
if test "$ac_cv_header_wchar_h" = no
then
U_HAVE_WCHAR_H=0
U_HAVE_WCSCPY=0
else
AC_DEFINE(HAVE_WCHAR_H)
U_HAVE_WCHAR_H=1
dnl Some broken systems have wchar.h but not some of its functions...
AC_SEARCH_LIBS(wcscpy, wcs w)
if test "$ac_cv_search_wcscpy" != no; then
U_HAVE_WCSCPY=1
else
U_HAVE_WCSCPY=0
fi
fi
AC_SUBST(U_HAVE_WCHAR_H)
AC_SUBST(U_HAVE_WCSCPY)
ac_default_sizeof_wchar_t=4
AC_DO_CHECK_SIZEOF(wchar_t,$ac_default_sizeof_wchar_t,[
#if STDC_HEADERS
#include <stddef.h>
#endif
#if HAVE_WCHAR_H
#include <string.h>
#include <wchar.h>
#endif])
dnl We could set ac_cv_sizeof_wchar_t to the default if the check returned
dnl 0 (unknown) but we'd rather do it in the headers, so we know we had no
dnl clue at configure time.
U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
if test $U_SIZEOF_WCHAR_T = 0; then
if test $U_HAVE_WCHAR_H=1; then
AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
fi
fi
AC_SUBST(U_SIZEOF_WCHAR_T)
dnl Echo
ECHO_N=$ac_n
ECHO_C=$ac_c
AC_SUBST(ECHO_N)
AC_SUBST(ECHO_C)
dnl Enable/disable extras
AC_ARG_ENABLE(extras,
[ --enable-extras build ICU extras [default=yes]],
[case "${enableval}" in
yes) extras=true ;;
no) extras=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
esac],
extras=true)
ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
AC_ARG_ENABLE(extras,
[ --enable-ustdio build ICU's ustdio library [default=yes]],
[case "${enableval}" in
yes) ustdio=true ;;
no) ustdio=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ustdio) ;;
esac],
ustdio=true)
ICU_CONDITIONAL(USTDIO, test "$ustdio" = true)
dnl Enable/disable layout
AC_ARG_ENABLE(layout,
[ --enable-layout build ICU's layout library [default=yes]],
[case "${enableval}" in
yes) layout=true ;;
no) layout=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
esac],
layout=true)
ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
AC_ARG_WITH(data-packaging,
[ --with-data-packaging=type specify how to package ICU data (files, archive, library, auto) [default=auto]],
[case "${withval}" in
files|archive|library) datapackaging=$withval ;;
auto) datapackaging=$withval ;;
common) datapackaging=archive ;;
dll) datapackaging=library ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
esac],
[datapackaging=])
thesysconfdir=`eval echo $sysconfdir`
AC_SUBST(thesysconfdir)
thedatadir=`eval echo $datadir`
AC_SUBST(thedatadir)
thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
AC_SUBST(thelibdir)
case $datapackaging in
common)
pkgicudatadir=$datadir
thepkgicudatadir=$thedatadir
;;
*)
pkgicudatadir=$libdir
thepkgicudatadir=$thelibdir
;;
esac
AC_SUBST(pkgicudatadir)
AC_SUBST(thepkgicudatadir)
dnl Shouldn't need the AC_SUBST
dnl Deprecated support for --enable-mapped
AC_ARG_ENABLE(mapped,,
[case "${enableval}" in
yes) mapped=archive ;;
no) mapped=library ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mapped; use --with-data-packaging now) ;;
esac],
[mapped=])
if test x"$mapped" != x; then
case $mapped in
archive)
AC_MSG_WARN(use --with-data-packaging=archive instead of --enable-mapped)
;;
library)
AC_MSG_WARN(use --with-data-packaging=library instead of --disable-mapped)
;;
esac
if test x"$datapackaging" != x -a x"$mapped" != x"$datapackaging"; then
AC_MSG_ERROR(conflicting values used for --with-data-packaging and deprecated --enable-mapped)
fi
datapackaging=$mapped
fi
if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
datapackaging=library
fi
case "$datapackaging" in
files)
DATA_PACKAGING_CPPFLAGS=-DUDATA_FILES
DATA_PACKAGING_MODE=files
;;
archive)
DATA_PACKAGING_CPPFLAGS=-DUDATA_MAP
DATA_PACKAGING_MODE=common
;;
library)
DATA_PACKAGING_CPPFLAGS=-DUDATA_DLL
DATA_PACKAGING_MODE=dll
;;
esac
AC_SUBST(DATA_PACKAGING_CPPFLAGS)
AC_SUBST(DATA_PACKAGING_MODE)
dnl Sets a library suffix
AC_MSG_CHECKING([for a library suffix to use])
AC_ARG_WITH(library-suffix,
[ --with-library-suffix=suffix tag a suffix to the library names [default=]],
[ICULIBSUFFIX="${withval}"],
[ICULIBSUFFIX=])
msg=$ICULIBSUFFIX
if test "$msg" = ""; then
msg=none
fi
AC_MSG_RESULT($msg)
AC_SUBST(ICULIBSUFFIX)
changequote(<<, >>)dnl
if test "$ICULIBSUFFIX" != ""
then
U_HAVE_LIB_SUFFIX=1
ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
else
U_HAVE_LIB_SUFFIX=0
fi
changequote([, ])dnl
AC_SUBST(U_HAVE_LIB_SUFFIX)
AC_SUBST(ICULIBSUFFIXCNAME)
dnl Enable/disable tests
AC_ARG_ENABLE(tests,
[ --enable-tests build ICU tests [default=yes]],
[case "${enableval}" in
yes) tests=true ;;
no) tests=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
esac],
tests=true)
ICU_CONDITIONAL(TESTS, test "$tests" = true)
dnl Enable/disable samples
AC_ARG_ENABLE(samples,
[ --enable-samples build ICU samples [default=yes]
Additionally, the variable FORCE_LIBS may be set before calling configure. If set, it will REPLACE any automatic list of libraries.],
[case "${enableval}" in
yes) samples=true ;;
no) samples=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
esac],
samples=true)
ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
ICUDATA_CHAR=$U_ENDIAN_CHAR
dnl Platform-specific Makefile setup
dnl set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
case "${host}" in
*-*-solaris*) platform=U_SOLARIS ;;
*-*-linux*) platform=U_LINUX ;;
*-*-*bsd*) platform=U_BSD ;;
*-*-aix*) platform=U_AIX ;;
*-*-hpux*) platform=U_HPUX ;;
*-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
*-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
*-*ibm-openedition*|*-*-os390*) platform=OS390
ICUDATA_CHAR="e" ;;
*-*-os400*) platform=OS400
ICUDATA_CHAR="e" ;;
*-*-nto*) platform=U_QNX ;;
*-dec-osf*) platform=U_OSF ;;
*-*-beos) platform=U_BEOS ;;
*-*-irix*) platform=U_IRIX ;;
*-ncr-*) platform=U_MPRAS ;;
*-sequent-*) platform=PTX ;;
*) platform=U_UNKNOWN_PLATFORM ;;
esac
AC_SUBST(ICUDATA_CHAR)
AC_SUBST(platform)
platform_make_fragment_name="$icu_cv_host_frag"
platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
AC_SUBST(platform_make_fragment_name)
AC_SUBST(platform_make_fragment)
dnl Handle -rpath options for shared library paths
case "${host}" in
*-*-solaris*) ld_rpath_suf=":" ;;
*-*-linux*) ld_rpath_suf=" " ;;
*-*-*bsd*) ld_rpath_suf=" " ;;
*-*-aix*) ld_rpath_suf="" ;;
*-*-hpux*) ld_rpath_suf=":" ;;
*-*ibm-openedition*|*-*-os390*) ld_rpath_suf="" ;;
*-*-os400*) ld_rpath_suf=" " ;;
*-sequent-*) ld_rpath_suf="" ;;
*-*-irix*) ld_rpath_suf=" " ;;
*) ld_rpath_suf="" ;;
esac
AC_SUBST(ld_rpath_suf)
dnl On HP/UX, main() functions compiled in C don't invoke
dnl static constructors in C++ libs. Hack around that here
dnl by renaming some .c files to .cpp
case "${host}" in
*-*-hpux*)
if test "${icu_cv_host_frag}" = "mh-hpux-cc"; then
for file in samples/date/date \
samples/cal/cal test/cintltst/cintltst \
tools/makeconv/makeconv tools/genrb/genrb \
tools/genrb/derb tools/genccode/genccode \
tools/gencmn/gencmn tools/gencmn/decmn \
tools/gencnval/gencnval tools/gennorm/gennorm \
tools/gennames/gennames tools/gentest/gentest \
tools/pkgdata/pkgdata tools/genprops/genprops \
tools/gensprep/gensprep
do
if test -f $file.c; then
mv $file.c $file.cpp
else
echo "# $file.c does not exist or is already renamed [warning]"
fi
done
fi
;;
esac
if test "${FORCE_LIBS}" != ""; then
echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
LIBS=${FORCE_LIBS}
fi
if test "${AIX_SHLIB}" != ""; then
echo " *** setting AIX_SHLIB (AIX only) to ${AIX_SHLIB}]" 1>&6
else
AIX_SHLIB=makeC++SharedLib_r
fi
AC_SUBST(AIX_SHLIB)
dnl Now that we're done using CPPFLAGS etc. for tests, we can change it
dnl for build.
if test $ICU_USE_THREADS -ne 0
then
CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
CFLAGS="$CFLAGS \$(THREADSCFLAGS)"
CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
fi
if test "$ac_cv_lib_dld_shl_load" = "yes"; then
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
fi
dnl added for s/390 DLL loading detection
if test "$ac_cv_func_dllload" = "yes"; then
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
fi
dnl output the Makefiles
AC_OUTPUT([icudefs.mk \
Makefile \
data/Makefile data/icupkg.inc \
common/Makefile config/Makefile.inc i18n/Makefile \
layout/Makefile \
layoutex/Makefile \
extra/Makefile extra/ustdio/Makefile \
extra/uconv/Makefile extra/scrptrun/Makefile
stubdata/Makefile \
tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \
tools/genrb/Makefile \
tools/genuca/Makefile \
tools/genccode/Makefile \
tools/gencmn/Makefile \
tools/gencnval/Makefile \
tools/gennames/Makefile \
tools/gentest/Makefile \
tools/gennorm/Makefile \
tools/genprops/Makefile \
tools/genpname/Makefile \
tools/genbrk/Makefile \
tools/gensprep/Makefile \
tools/icuswap/Makefile \
tools/pkgdata/Makefile \
tools/toolutil/Makefile \
tools/dumpce/Makefile \
test/Makefile test/testdata/Makefile \
test/intltest/Makefile \
test/cintltst/Makefile \
test/iotest/Makefile \
test/ieeetest/Makefile \
test/thaitest/Makefile \
test/testmap/Makefile \
test/letest/Makefile \
test/threadtest/Makefile \
samples/Makefile samples/date/Makefile \
samples/cal/Makefile samples/layout/Makefile \
common/unicode/platform.h])
if test $ICU_USE_THREADS = 0; then
echo " *** Note: configuring the ICU without pthread support or testing. If this isn't what you want, then run configure with --enable-threads=yes or check the messages [above] to see why we couldn't find pthread_create()" 1>&6
fi
echo "You must use $U_MAKE to build ICU."
|