Line 0
Link Here
|
|
|
1 |
--- m4/gettext.m4.orig 2010-01-03 21:26:04.000000000 +0900 |
2 |
+++ m4/gettext.m4 2014-04-03 10:20:12.000000000 +0900 |
3 |
@@ -87,13 +87,19 @@ |
4 |
save_LIBS=$LIBS |
5 |
CPPFLAGS="$save_CPPFLAGS $iconv_includes" |
6 |
LIBS="$save_LIBS $iconv_libraries" |
7 |
- AC_CHECK_LIB(iconv, iconv_open, |
8 |
- [ICONVLIBS="$iconv_libraries -liconv"; LIBS="$LIBS -liconv"]) |
9 |
- AC_CHECK_FUNCS(iconv_open locale_charset) |
10 |
- AC_CHECK_HEADERS(iconv.h libcharset.h) |
11 |
- if test $ac_cv_func_iconv_open != no; then |
12 |
- ICONVINCS="$iconv_includes" |
13 |
- fi |
14 |
+ initial_LIBS="$LIBS" |
15 |
+ AC_SEARCH_LIBS([iconv_open], |
16 |
+ [iconv], |
17 |
+ [AS_IF([test "$LIBS" = "$initial_LIBS"], |
18 |
+ [AC_CHECK_HEADERS([iconv.h]) |
19 |
+ AC_CHECK_FUNCS([iconv_open]) |
20 |
+ ICONVLIBS="$iconv_libraries" |
21 |
+ ICONVINCS="$iconv_includes"], |
22 |
+ [AC_CHECK_LIB([charset], [locale_charset]) |
23 |
+ AC_CHECK_HEADERS([iconv.h libcharset.h]) |
24 |
+ AC_CHECK_FUNCS([iconv_open locale_charset]) |
25 |
+ ICONVLIBS="$iconv_libraries -lcharset -liconv" |
26 |
+ ICONVINCS="$iconv_includes"])]) |
27 |
CPPFLAGS=$save_CPPFLAGS |
28 |
LIBS=$save_LIBS |
29 |
AC_SUBST(ICONVINCS) |
30 |
@@ -113,10 +119,10 @@ |
31 |
save_LIBS=$LIBS |
32 |
|
33 |
dnl * |
34 |
- dnl * Test 1: Try to link both libintl and libiconv. |
35 |
+ dnl * Test 1: Try to link libc only. |
36 |
dnl * |
37 |
- CPPFLAGS="$save_CPPFLAGS $gettext_includes" |
38 |
- LIBS="$save_LIBS $gettext_libraries -lintl $iconv_libraries -liconv" |
39 |
+ CPPFLAGS="$save_CPPFLAGS" |
40 |
+ LIBS="$save_LIBS" |
41 |
AC_LINK_IFELSE([ |
42 |
#include <stdio.h> |
43 |
#ifdef ENABLE_NLS |
44 |
@@ -143,8 +149,8 @@ |
45 |
try_nls=yes, try_nls=no) |
46 |
|
47 |
if test "$try_nls" = yes; then |
48 |
- INTLINCS="$gettext_includes" |
49 |
- INTLLIBS="$gettext_libraries -lintl $iconv_libraries -liconv" |
50 |
+ INTLINCS= |
51 |
+ INTLLIBS= |
52 |
fi |
53 |
|
54 |
dnl * |
55 |
@@ -222,11 +228,11 @@ |
56 |
fi |
57 |
|
58 |
dnl * |
59 |
- dnl * Test 4: Try to link libc only. |
60 |
+ dnl * Test 4: Try to link both libintl and libiconv. |
61 |
dnl * |
62 |
if test "$try_nls" = no; then |
63 |
- CPPFLAGS="$save_CPPFLAGS" |
64 |
- LIBS="$save_LIBS" |
65 |
+ CPPFLAGS="$save_CPPFLAGS $gettext_includes" |
66 |
+ LIBS="$save_LIBS $gettext_libraries -lintl $iconv_libraries -liconv" |
67 |
AC_LINK_IFELSE([ |
68 |
#include <stdio.h> |
69 |
#ifdef ENABLE_NLS |
70 |
@@ -253,8 +259,8 @@ |
71 |
try_nls=yes, try_nls=no) |
72 |
|
73 |
if test "$try_nls" = yes; then |
74 |
- INTLINCS= |
75 |
- INTLLIBS= |
76 |
+ INTLINCS="$gettext_includes" |
77 |
+ INTLLIBS="$gettext_libraries -lintl $iconv_libraries -liconv" |
78 |
fi |
79 |
fi |
80 |
|