-
-dnl
-dnl Check for which locale library to use: gnu or generic.
-dnl
-dnl GLIBCPP_ENABLE_CLOCALE
-dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
-dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
-dnl
-dnl default is generic
-dnl
-AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
- AC_MSG_CHECKING([for clocale to use])
- AC_ARG_ENABLE(clocale,
- [ --enable-clocale enable model for target locale package.
- --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
- ],
- if test x$enable_clocale = xno; then
- enable_clocale=no
- fi,
- enable_clocale=no)
-
- enable_clocale_flag=$enable_clocale
-
- dnl Probe for locale support if no specific model is specified.
- dnl Default to "generic"
- if test x$enable_clocale_flag = xno; then
- case x${target_os} in
- xlinux* | xgnu*)
- AC_EGREP_CPP([_GLIBCPP_ok], [
- #include <features.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
- _GLIBCPP_ok
- #endif
- ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
-
- # Test for bugs early in glibc-2.2.x series
- if test x$enable_clocale_flag = xgnu; then
- AC_TRY_RUN([
- #define _GNU_SOURCE 1
- #include <locale.h>
- #include <string.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- extern __typeof(newlocale) __newlocale;
- extern __typeof(duplocale) __duplocale;
- extern __typeof(strcoll_l) __strcoll_l;
- #endif
- int main()
- {
- const char __one[] = "Äuglein Augmen";
- const char __two[] = "Äuglein";
- int i;
- int j;
- __locale_t loc;
- __locale_t loc_dup;
- loc = __newlocale(1 << LC_ALL, "de_DE", 0);
- loc_dup = __duplocale(loc);
- i = __strcoll_l(__one, __two, loc);
- j = __strcoll_l(__one, __two, loc_dup);
- return 0;
- }
- ],
- [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
- [enable_clocale_flag=generic])
- fi
-
- # ... at some point put __strxfrm_l tests in as well.
- ;;
- *)
- enable_clocale_flag=generic
- ;;
- esac
- fi
-
- dnl Deal with gettext issues.
- AC_ARG_ENABLE(nls,
- [ --enable-nls use Native Language Support (default)],
- , enable_nls=yes)
- USE_NLS=no
-
- dnl Set configure bits for specified locale package
- case x${enable_clocale_flag} in
- xgeneric)
- AC_MSG_RESULT(generic)
-
- CLOCALE_H=config/locale/generic/c_locale.h
- CLOCALE_CC=config/locale/generic/c_locale.cc
- CCODECVT_H=config/locale/generic/codecvt_specializations.h
- CCODECVT_CC=config/locale/generic/codecvt_members.cc
- CCOLLATE_CC=config/locale/generic/collate_members.cc
- CCTYPE_CC=config/locale/generic/ctype_members.cc
- CMESSAGES_H=config/locale/generic/messages_members.h
- CMESSAGES_CC=config/locale/generic/messages_members.cc
- CMONEY_CC=config/locale/generic/monetary_members.cc
- CNUMERIC_CC=config/locale/generic/numeric_members.cc
- CTIME_H=config/locale/generic/time_members.h
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
- xgnu)
- AC_MSG_RESULT(gnu)
-
- # Declare intention to use gettext, and add support for specific
- # languages.
- # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
- ALL_LINGUAS="de fr"
-
- # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
- AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
- if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
- USE_NLS=yes
- fi
- # Export the build objects.
- for ling in $ALL_LINGUAS; do \
- glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
- glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
- done
- AC_SUBST(glibcpp_MOFILES)
- AC_SUBST(glibcpp_POFILES)
-
- CLOCALE_H=config/locale/gnu/c_locale.h
- CLOCALE_CC=config/locale/gnu/c_locale.cc
- CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
- CCODECVT_CC=config/locale/gnu/codecvt_members.cc
- CCOLLATE_CC=config/locale/gnu/collate_members.cc
- CCTYPE_CC=config/locale/gnu/ctype_members.cc
- CMESSAGES_H=config/locale/gnu/messages_members.h
- CMESSAGES_CC=config/locale/gnu/messages_members.cc
- CMONEY_CC=config/locale/gnu/monetary_members.cc
- CNUMERIC_CC=config/locale/gnu/numeric_members.cc
- CTIME_H=config/locale/gnu/time_members.h
- CTIME_CC=config/locale/gnu/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
- ;;
- xieee_1003.1-2001)
- AC_MSG_RESULT(generic)
-
- CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
- CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
- CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
- CCODECVT_CC=config/locale/generic/codecvt_members.cc
- CCOLLATE_CC=config/locale/generic/collate_members.cc
- CCTYPE_CC=config/locale/generic/ctype_members.cc
- CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
- CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
- CMONEY_CC=config/locale/generic/monetary_members.cc
- CNUMERIC_CC=config/locale/generic/numeric_members.cc
- CTIME_H=config/locale/generic/time_members.h
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
- *)
- echo "$enable_clocale is an unknown locale package" 1>&2
- exit 1
- ;;
- esac
-
- # This is where the testsuite looks for locale catalogs, using the
- # -DLOCALEDIR define during testsuite compilation.
- glibcpp_localedir=${glibcpp_builddir}/po/share/locale
- AC_SUBST(glibcpp_localedir)
-
- AC_SUBST(USE_NLS)
- AC_SUBST(CLOCALE_H)
- AC_SUBST(CCODECVT_H)
- AC_SUBST(CMESSAGES_H)
- AC_SUBST(CCODECVT_CC)
- AC_SUBST(CCOLLATE_CC)
- AC_SUBST(CCTYPE_CC)
- AC_SUBST(CMESSAGES_CC)
- AC_SUBST(CMONEY_CC)
- AC_SUBST(CNUMERIC_CC)
- AC_SUBST(CTIME_H)
- AC_SUBST(CTIME_CC)
- AC_SUBST(CLOCALE_CC)
- AC_SUBST(CLOCALE_INTERNAL_H)
-])
-
-
-dnl
-dnl Check for which I/O library to use: libio, or something specific.
-dnl
-dnl GLIBCPP_ENABLE_CSTDIO
-dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
-dnl
-dnl default is stdio
-dnl
-AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
- AC_MSG_CHECKING([for cstdio to use])
- AC_ARG_ENABLE(cstdio,
- [ --enable-cstdio enable stdio for target io package.
- --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
- ],
- if test x$enable_cstdio = xno; then
- enable_cstdio=stdio
- fi,
- enable_cstdio=stdio)
-
- enable_cstdio_flag=$enable_cstdio
-
- dnl Check if a valid I/O package
- case x${enable_cstdio_flag} in
- xlibio)
- CSTDIO_H=config/io/c_io_libio.h
- BASIC_FILE_H=config/io/basic_file_libio.h
- BASIC_FILE_CC=config/io/basic_file_libio.cc
- AC_MSG_RESULT(libio)
-
- # see if we are on a system with libio native (ie, linux)
- AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
-
- # Need to check and see what version of glibc is being used. If
- # it's not glibc-2.2 or higher, then we'll need to go ahead and
- # compile most of libio for linux systems.
- if test x$has_libio = x"yes"; then
- case "$target" in
- *-*-linux*)
- AC_MSG_CHECKING([for glibc version >= 2.2])
- AC_EGREP_CPP([ok], [
- #include <features.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
- ok
- #endif
- ], glibc_satisfactory=yes, glibc_satisfactory=no)
- AC_MSG_RESULT($glibc_satisfactory)
- ;;
- esac
-
- # XXX at the moment, admit defeat and force the recompilation
- # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
- glibc_satisfactory=no
-
- if test x$glibc_satisfactory = x"yes"; then
- need_libio=no
- need_wlibio=no
- else
- need_libio=yes
- # bkoz XXX need to add checks to enable this
- # pme XXX here's a first pass at such a check
- if test x$enable_c_mbchar != xno; then
- need_wlibio=yes
- else
- need_wlibio=no
- fi
- fi
-
- else
- # Using libio, but <libio.h> doesn't exist on the target system. . .
- need_libio=yes
- # bkoz XXX need to add checks to enable this
- # pme XXX here's a first pass at such a check
- if test x$enable_c_mbchar != xno; then
- need_wlibio=yes
- else
- need_wlibio=no
- fi
- fi
- ;;
- xstdio | x | xno | xnone | xyes)
- # default
- CSTDIO_H=config/io/c_io_stdio.h
- BASIC_FILE_H=config/io/basic_file_stdio.h
- BASIC_FILE_CC=config/io/basic_file_stdio.cc
- AC_MSG_RESULT(stdio)
-
- # We're not using stdio.
- need_libio=no
- need_wlibio=no
- ;;
- *)
- echo "$enable_cstdio is an unknown io package" 1>&2
- exit 1
- ;;
- esac
- AC_SUBST(CSTDIO_H)
- AC_SUBST(BASIC_FILE_H)
- AC_SUBST(BASIC_FILE_CC)
-
- # 2000-08-04 bkoz hack
- CCODECVT_C=config/io/c_io_libio_codecvt.c
- AC_SUBST(CCODECVT_C)
- # 2000-08-04 bkoz hack
-
- AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
- test "$need_libio" = yes || test "$need_wlibio" = yes)
- AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
- AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
- if test "$need_libio" = yes || test "$need_wlibio" = yes; then
- libio_la=../libio/libio.la