Tiny whitespace cleanup
[sxemacs] / m4 / sxe-iconv.m4
1 dnl sxe-iconv.m4 -- mule and other coding system stuff
2
3 dnl MULE stuff
4 dnl ==========
5
6 AC_DEFUN([SXE_CHECK_MULE], [dnl
7         AC_MSG_CHECKING([for mule-related features])
8         AC_MSG_RESULT([])
9
10         AC_DEFINE([MULE], [1], [Description here!])
11
12         AC_DEFINE([ENCAPSULATE_CHDIR], [], [directory calls encapsulation])
13         AC_DEFINE([ENCAPSULATE_MKDIR], [], [directory calls encapsulation])
14         AC_DEFINE([ENCAPSULATE_OPENDIR], [], [directory calls encapsulation])
15         AC_DEFINE([ENCAPSULATE_READDIR], [], [directory calls encapsulation])
16         AC_DEFINE([ENCAPSULATE_RMDIR], [], [directory calls encapsulation])
17
18         if test "$ac_cv_func_eaccess" = "yes"; then
19                 AC_DEFINE([ENCAPSULATE_EACCESS], [], [file information calls])
20         fi
21         AC_DEFINE([ENCAPSULATE_ACCESS], [], [file information calls])
22         AC_DEFINE([ENCAPSULATE_LSTAT], [], [file information calls])
23         AC_DEFINE([ENCAPSULATE_READLINK], [], [file information calls])
24         AC_DEFINE([ENCAPSULATE_STAT], [], [file information calls])
25
26         AC_DEFINE([ENCAPSULATE_CHMOD], [], [file manipulation calls])
27         AC_DEFINE([ENCAPSULATE_CREAT], [], [file manipulation calls])
28         AC_DEFINE([ENCAPSULATE_LINK], [], [file manipulation calls])
29         AC_DEFINE([ENCAPSULATE_RENAME], [], [file manipulation calls])
30         AC_DEFINE([ENCAPSULATE_SYMLINK], [], [file manipulation calls])
31         AC_DEFINE([ENCAPSULATE_UNLINK], [], [file manipulation calls])
32         AC_DEFINE([ENCAPSULATE_EXECVP], [], [file manipulation calls])
33
34         MULE=yes
35         have_mule=yes
36         AC_DEFINE([FILE_CODING], [1], [Description here!])
37         SXE_ADD_MULE_OBJS([mule.o mule-ccl.o mule-charset.o file-coding.o])
38
39         dnl Use -lintl to get internationalized strerror for Mule
40         SXE_CHECK_HEADERS([libintl.h])
41         AC_CHECK_LIB([intl], [strerror], [:], [:])
42
43         AC_MSG_CHECKING([for mule input methods])
44         AC_MSG_RESULT([])
45
46         SXE_CHECK_XIM
47         SXE_CHECK_XFS
48 ])dnl SXE_CHECK_MULE
49
50 AC_DEFUN([SXE_CHECK_XIM], [dnl
51         ## Do we have the XmIm* routines?  And if so, do we want to use them?
52         ## XIM seems to be flaky except on Solaris...
53         ## test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no
54         case "$with_xim" in
55         "" | "yes" )
56                 AC_MSG_CHECKING([for XIM])
57                 AC_MSG_RESULT([])
58                 AC_CHECK_LIB([X11], [XOpenIM], [with_xim=xlib], [with_xim=no])
59                 dnl XIM + Lesstif is not (yet?) usable
60                 if test "$have_motif $have_lesstif" = "yes no"; then
61                         AC_CHECK_LIB([Xm], [XmImMbLookupString], [with_xim=motif])
62                 fi
63                 ;;
64         esac
65
66         if test "$with_xim" != "no"; then
67                 AC_DEFINE([HAVE_XIM], [1], [Description here!])
68                 if test "$with_xim" = "xlib"; then
69                         AC_DEFINE([XIM_XLIB], [1], [Description here!])
70                         SXE_ADD_MULE_OBJS([input-method-xlib.o])
71                 fi
72                 if test "$with_xim" = "motif"; then
73                         AC_DEFINE([XIM_MOTIF], [1], [Description here!])
74                         need_motif=yes
75                         SXE_ADD_MULE_OBJS([input-method-motif.o])
76                 fi
77                 if test "$with_xim" = "motif"; then
78                         with_xfs=no
79                 fi
80         fi
81 ])dnl SXE_CHECK_XIM
82
83 AC_DEFUN([SXE_CHECK_XFS], [dnl
84         dnl "with_xfs" = "yes"
85         if test "$with_xfs" = "yes"; then
86                 AC_MSG_CHECKING([for XFontSet])
87                 AC_MSG_RESULT([])
88                 AC_CHECK_LIB([X11], [XmbDrawString], [:], [with_xfs=no])
89                 if test "$with_xfs" = "yes" -a "$with_menubars" = "lucid"; then
90                         AC_DEFINE([USE_XFONTSET], [1], [Description here!])
91                         if test "$with_xim" = "no"; then
92                                 SXE_ADD_MULE_OBJS([input-method-xlib.o])
93                         fi
94                 fi
95         fi dnl with_xfs
96 ])dnl SXE_CHECK_XFS
97
98 AC_DEFUN([SXE_CHECK_WNN], [dnl
99         dnl Autodetect WNN
100         if test "$with_wnn6" = "yes"; then
101                 with_wnn=yes # wnn6 implies wnn support
102                 SXE_CHECK_HEADERS([wnn/jllib.h wnn/commonhd.h])
103                 if test "$ac_cv_header_wnn_jllib_h" != "yes" -o \
104                         "$ac_cv_header_wnn_commonhd_h" != "yes"; then
105                         with_wnn=no
106                 fi
107                 dnl gcc 2.97 fixincludes breaks inclusion of wnn/commonhd.h
108                 dnl Detour to find crypt
109                 AC_CHECK_FUNCS([crypt])
110                 if test "$ac_cv_func_crypt" != "yes"; then
111                         AC_CHECK_LIB([crypt], [crypt])
112                 fi
113                 dnl Back to our regularly scheduled wnn hunting
114                 SXE_CHECK_LIB_FUNCS([wnn wnn4 wnn6 wnn6_fromsrc],
115                         [jl_dic_list_e jl_fi_dic_list])
116
117                 if test "$ac_cv_lib_wnn_jl_dic_list_e" = "yes"; then
118                         libwnn=wnn
119                         have_wnn=yes
120                 elif test "$ac_cv_lib_wnn4_jl_dic_list_e" = "yes"; then
121                         libwnn=wnn4
122                         have_wnn=yes
123                 elif test "$ac_cv_lib_wnn6_jl_dic_list_e" = "yes"; then
124                         libwnn=wnn6
125                         have_wnn=yes
126                 elif test "$ac_cv_lib_wnn6_fromsrc_jl_dic_list_e" = "yes"; then
127                         libwnn=wnn6_fromsrc
128                         have_wnn=yes
129                 else
130                         have_wnn=no
131                 fi
132
133                 if test "$have_wnn" = "yes"; then
134                         AC_DEFINE([HAVE_WNN], [1], [Description here!])
135                         SXE_PREPEND([-l$libwnn], [libs_x])
136                         SXE_ADD_MULE_OBJS([mule-wnnfns.o])
137                 fi
138                 if test "$ac_cv_lib_wnn_jl_dic_list" = "yes" -o \
139                         "$ac_cv_lib_wnn4_jl_dic_list" = "yes" -o \
140                         "$ac_cv_lib_wnn6_jl_dic_list" = "yes" -o \
141                         "$ac_cv_lib_wnn6_fromsrc_jl_dic_list" = "yes"; then
142                         AC_DEFINE([WNN6], [1], [Description here!])
143                 fi
144         fi
145 ])dnl SXE_CHECK_WNN
146
147 AC_DEFUN([SXE_CHECK_CANNA], [dnl
148         dnl Autodetect canna
149         if test "$with_canna" != "no"; then
150                 SXE_CHECK_HEADERS([canna/jrkanji.h])
151         fi
152         if test "$ac_cv_header_canna_jrkanji_h" != "yes"; then
153                 SXE_DUMP_LIBS
154                 CPPFLAGS="-I/usr/local/canna/include $CPPFLAGS"
155                 unset ac_cv_header_canna_jrkanji_h
156                 SXE_CHECK_HEADERS([canna/jrkanji.h])
157                 SXE_RESTORE_LIBS
158         fi
159         if test "$ac_cv_header_canna_jrkanji_h" != "yes"; then
160                 CPPFLAGS="$CPPFLAGS -I/usr/local/canna/include"
161         fi
162
163         have_canna="yes"
164         AC_CHECK_HEADER([canna/RK.h], [:], [have_canna=no])
165         AC_CHECK_LIB([RKC], [RkBgnBun], [:], [have_canna=no])
166         AC_CHECK_LIB([canna], [jrKanjiControl], [:], [have_canna=no])
167         if test "$have_canna" = "yes"; then
168                 AC_DEFINE([HAVE_CANNA], [1], [Description here!])
169                 SXE_PREPEND([-lcanna -lRKC], [libs_x])
170                 SXE_ADD_MULE_OBJS([mule-canna.o])
171
172                 AC_DEFINE([CANNA2], [], [Description here!])
173                 AC_DEFINE([CANNA_MULE], [], [Description here!])
174                 AC_DEFINE([CANNA_PURESIZE], [0], [Description here!])
175         else
176                 AC_DEFINE([CANNA_PURESIZE], [0], [Description here!])
177         fi
178 ])dnl SXE_CHECK_CANNA
179
180 dnl sxe-iconv.m4 ends here