View | Details | Raw Unified | Return to bug 11074
Collapse All | Expand All

(-)acinclude.m4 (-2 / +38 lines)
Lines 1165-1173 AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ Link Here
1165
  AC_SUBST(glibcxx_localedir)
1165
  AC_SUBST(glibcxx_localedir)
1166
1166
1167
  # A standalone libintl (e.g., GNU libintl) may be in use.
1167
  # A standalone libintl (e.g., GNU libintl) may be in use.
1168
  # Note that we use AC_LINK_IFELSE and not AC_SEARCH_LIBS, as a
1169
  # standalone libintl's header may redefine gettext & co to avoid
1170
  # symbol name conflicts (e.g. GNU libintl redefines them to
1171
  # libintl_gettext() etc. on systems where the C library has a
1172
  # gettext() of its own).
1168
  if test $USE_NLS = yes; then
1173
  if test $USE_NLS = yes; then
1169
    AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
1174
    AC_CHECK_HEADERS([libintl.h], [], [USE_NLS=no])
1170
    AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
1175
    if test $USE_NLS = yes; then
1176
      AC_MSG_CHECKING([whether gettext requires additional libraries])
1177
      save_LIBS=$LIBS
1178
      LIBS=
1179
      gettext_link_ok=no
1180
      AC_LINK_IFELSE(AC_LANG_PROGRAM([@%:@include <libintl.h>],
1181
                                     [gettext("foo")]),
1182
                     [gettext_link_ok=yes], [])
1183
      if test $gettext_link_ok = no; then
1184
         LIBS="-lintl"
1185
         AC_LINK_IFELSE(AC_LANG_PROGRAM([@%:@include <libintl.h>],
1186
                                        [gettext("foo")]),
1187
                        [gettext_link_ok=yes], [])
1188
      fi
1189
      if test $gettext_link_ok = no; then
1190
         LIBS="-lintl -liconv"
1191
         AC_LINK_IFELSE(AC_LANG_PROGRAM([@%:@include <libintl.h>],
1192
                                        [gettext("foo")]),
1193
                        [gettext_link_ok=yes], [])
1194
      fi
1195
      if test $gettext_link_ok = no; then
1196
        AC_MSG_RESULT([*cannot link* (NLS disabled)])
1197
        USE_NLS=no
1198
        LIBS=$save_LIBS
1199
      elif test -z "$LIBS"; then
1200
        AC_MSG_RESULT([no])
1201
        LIBS=$save_LIBS
1202
      else
1203
        AC_MSG_RESULT([yes ($LIBS)])
1204
        LIBS="$save_LIBS $LIBS"
1205
      fi
1206
    fi
1171
  fi
1207
  fi
1172
  if test $USE_NLS = yes; then
1208
  if test $USE_NLS = yes; then
1173
    AC_DEFINE(_GLIBCXX_USE_NLS)
1209
    AC_DEFINE(_GLIBCXX_USE_NLS)

Return to bug 11074