]>
Commit | Line | Data |
---|---|---|
c9bf22f1 | 1 | --- flux-0.4.1/acinclude.m4~ Sun Dec 2 12:50:00 2001 |
2 | +++ flux-0.4.1/acinclude.m4 Sun Dec 2 12:50:00 2001 | |
3 | @@ -194,719 +194,3 @@ | |
4 | ||
5 | ||
6 | ||
7 | - | |
8 | - | |
9 | -# Macro to add for using GNU gettext. | |
10 | -# Ulrich Drepper <drepper@cygnus.com>, 1995. | |
11 | -# | |
12 | -# This file can be copied and used freely without restrictions. It can | |
13 | -# be used in projects which are not available under the GNU Public License | |
14 | -# but which still want to provide support for the GNU gettext functionality. | |
15 | -# Please note that the actual code is *not* freely available. | |
16 | - | |
17 | -# serial 5 + patch (wk 21.10.98) | |
18 | - | |
19 | -AC_DEFUN(AM_WITH_NLS, | |
20 | - [AC_MSG_CHECKING([whether NLS is requested]) | |
21 | - dnl Default is enabled NLS | |
22 | - AC_ARG_ENABLE(nls, | |
23 | - [ --disable-nls do not use Native Language Support], | |
24 | - USE_NLS=$enableval, USE_NLS=yes) | |
25 | - AC_MSG_RESULT($USE_NLS) | |
26 | - AC_SUBST(USE_NLS) | |
27 | - | |
28 | - USE_INCLUDED_LIBINTL=no | |
29 | - | |
30 | - dnl If we use NLS figure out what method | |
31 | - if test "$USE_NLS" = "yes"; then | |
32 | - AC_DEFINE(ENABLE_NLS) | |
33 | - AC_MSG_CHECKING([whether included gettext is requested]) | |
34 | - AC_ARG_WITH(included-gettext, | |
35 | - [ --with-included-gettext use the GNU gettext library included here], | |
36 | - nls_cv_force_use_gnu_gettext=$withval, | |
37 | - nls_cv_force_use_gnu_gettext=no) | |
38 | - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) | |
39 | - | |
40 | - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" | |
41 | - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then | |
42 | - dnl User does not insist on using GNU NLS library. Figure out what | |
43 | - dnl to use. If gettext or catgets are available (in this order) we | |
44 | - dnl use this. Else we have to fall back to GNU NLS library. | |
45 | - dnl catgets is only used if permitted by option --with-catgets. | |
46 | - nls_cv_header_intl= | |
47 | - nls_cv_header_libgt= | |
48 | - CATOBJEXT=NONE | |
49 | - | |
50 | - AC_CHECK_HEADER(libintl.h, | |
51 | - [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, | |
52 | - [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], | |
53 | - gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) | |
54 | - | |
55 | - if test "$gt_cv_func_gettext_libc" != "yes"; then | |
56 | - AC_CHECK_LIB(intl, bindtextdomain, | |
57 | - [AC_CHECK_LIB(intl, gettext, | |
58 | - gt_cv_func_gettext_libintl=yes, | |
59 | - gt_cv_func_gettext_libintl=no)]) | |
60 | - fi | |
61 | - | |
62 | - if test "$gt_cv_func_gettext_libintl" = "yes" ; then | |
63 | - LIBS="-lintl $LIBS" | |
64 | - fi | |
65 | - | |
66 | - if test "$gt_cv_func_gettext_libc" = "yes" \ | |
67 | - || test "$gt_cv_func_gettext_libintl" = "yes"; then | |
68 | - AC_DEFINE(HAVE_GETTEXT) | |
69 | - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
70 | - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl | |
71 | - if test "$MSGFMT" != "no"; then | |
72 | - AC_CHECK_FUNCS(dcgettext) | |
73 | - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
74 | - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
75 | - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
76 | - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; | |
77 | - return _nl_msg_cat_cntr], | |
78 | - [CATOBJEXT=.gmo | |
79 | - DATADIRNAME=share], | |
80 | - [CATOBJEXT=.mo | |
81 | - DATADIRNAME=lib]) | |
82 | - INSTOBJEXT=.mo | |
83 | - fi | |
84 | - fi | |
85 | - ]) | |
86 | - | |
87 | - if test "$CATOBJEXT" = "NONE"; then | |
88 | - AC_MSG_CHECKING([whether catgets can be used]) | |
89 | - AC_ARG_WITH(catgets, | |
90 | - [ --with-catgets use catgets functions if available], | |
91 | - nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) | |
92 | - AC_MSG_RESULT($nls_cv_use_catgets) | |
93 | - | |
94 | - if test "$nls_cv_use_catgets" = "yes"; then | |
95 | - dnl No gettext in C library. Try catgets next. | |
96 | - AC_CHECK_LIB(i, main) | |
97 | - AC_CHECK_FUNC(catgets, | |
98 | - [AC_DEFINE(HAVE_CATGETS) | |
99 | - INTLOBJS="\$(CATOBJS)" | |
100 | - AC_PATH_PROG(GENCAT, gencat, no)dnl | |
101 | - if test "$GENCAT" != "no"; then | |
102 | - AC_PATH_PROG(GMSGFMT, gmsgfmt, no) | |
103 | - if test "$GMSGFMT" = "no"; then | |
104 | - AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, | |
105 | - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) | |
106 | - fi | |
107 | - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
108 | - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
109 | - USE_INCLUDED_LIBINTL=yes | |
110 | - CATOBJEXT=.cat | |
111 | - INSTOBJEXT=.cat | |
112 | - DATADIRNAME=lib | |
113 | - INTLDEPS='$(top_builddir)/intl/libintl.a' | |
114 | - INTLLIBS=$INTLDEPS | |
115 | - LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
116 | - nls_cv_header_intl=intl/libintl.h | |
117 | - nls_cv_header_libgt=intl/libgettext.h | |
118 | - fi]) | |
119 | - fi | |
120 | - fi | |
121 | - | |
122 | - if test "$CATOBJEXT" = "NONE"; then | |
123 | - dnl Neither gettext nor catgets in included in the C library. | |
124 | - dnl Fall back on GNU gettext library. | |
125 | - nls_cv_use_gnu_gettext=yes | |
126 | - fi | |
127 | - fi | |
128 | - | |
129 | - if test "$nls_cv_use_gnu_gettext" = "yes"; then | |
130 | - dnl Mark actions used to generate GNU NLS library. | |
131 | - INTLOBJS="\$(GETTOBJS)" | |
132 | - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
133 | - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) | |
134 | - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
135 | - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
136 | - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
137 | - AC_SUBST(MSGFMT) | |
138 | - USE_INCLUDED_LIBINTL=yes | |
139 | - CATOBJEXT=.gmo | |
140 | - INSTOBJEXT=.mo | |
141 | - DATADIRNAME=share | |
142 | - INTLDEPS='$(top_builddir)/intl/libintl.a' | |
143 | - INTLLIBS=$INTLDEPS | |
144 | - LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
145 | - nls_cv_header_intl=intl/libintl.h | |
146 | - nls_cv_header_libgt=intl/libgettext.h | |
147 | - fi | |
148 | - | |
149 | - dnl Test whether we really found GNU xgettext. | |
150 | - if test "$XGETTEXT" != ":"; then | |
151 | - dnl If it is no GNU xgettext we define it as : so that the | |
152 | - dnl Makefiles still can work. | |
153 | - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then | |
154 | - : ; | |
155 | - else | |
156 | - AC_MSG_RESULT( | |
157 | - [found xgettext program is not GNU xgettext; ignore it]) | |
158 | - XGETTEXT=":" | |
159 | - fi | |
160 | - fi | |
161 | - | |
162 | - # We need to process the po/ directory. | |
163 | - POSUB=po | |
164 | - else | |
165 | - DATADIRNAME=share | |
166 | - nls_cv_header_intl=intl/libintl.h | |
167 | - nls_cv_header_libgt=intl/libgettext.h | |
168 | - fi | |
169 | - AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) | |
170 | - AC_OUTPUT_COMMANDS( | |
171 | - [case "$CONFIG_FILES" in *po/Makefile.in*) | |
172 | - sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile | |
173 | - esac]) | |
174 | - | |
175 | - | |
176 | - # If this is used in GNU gettext we have to set USE_NLS to `yes' | |
177 | - # because some of the sources are only built for this goal. | |
178 | - if test "$PACKAGE" = gettext; then | |
179 | - USE_NLS=yes | |
180 | - USE_INCLUDED_LIBINTL=yes | |
181 | - fi | |
182 | - | |
183 | - dnl These rules are solely for the distribution goal. While doing this | |
184 | - dnl we only have to keep exactly one list of the available catalogs | |
185 | - dnl in configure.in. | |
186 | - for lang in $ALL_LINGUAS; do | |
187 | - GMOFILES="$GMOFILES $lang.gmo" | |
188 | - POFILES="$POFILES $lang.po" | |
189 | - done | |
190 | - | |
191 | - dnl Make all variables we use known to autoconf. | |
192 | - AC_SUBST(USE_INCLUDED_LIBINTL) | |
193 | - AC_SUBST(CATALOGS) | |
194 | - AC_SUBST(CATOBJEXT) | |
195 | - AC_SUBST(DATADIRNAME) | |
196 | - AC_SUBST(GMOFILES) | |
197 | - AC_SUBST(INSTOBJEXT) | |
198 | - AC_SUBST(INTLDEPS) | |
199 | - AC_SUBST(INTLLIBS) | |
200 | - AC_SUBST(INTLOBJS) | |
201 | - AC_SUBST(POFILES) | |
202 | - AC_SUBST(POSUB) | |
203 | - ]) | |
204 | - | |
205 | - | |
206 | -AC_DEFUN(AM_GNU_GETTEXT, | |
207 | - [AC_REQUIRE([AC_PROG_MAKE_SET])dnl | |
208 | - AC_REQUIRE([AC_PROG_CC])dnl | |
209 | - AC_REQUIRE([AC_PROG_RANLIB])dnl | |
210 | - AC_REQUIRE([AC_ISC_POSIX])dnl | |
211 | - AC_REQUIRE([AC_HEADER_STDC])dnl | |
212 | - AC_REQUIRE([AC_C_CONST])dnl | |
213 | - AC_REQUIRE([AC_C_INLINE])dnl | |
214 | - AC_REQUIRE([AC_TYPE_OFF_T])dnl | |
215 | - AC_REQUIRE([AC_TYPE_SIZE_T])dnl | |
216 | - AC_REQUIRE([AC_FUNC_ALLOCA])dnl | |
217 | - AC_REQUIRE([AC_FUNC_MMAP])dnl | |
218 | - | |
219 | - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ | |
220 | -unistd.h sys/param.h]) | |
221 | - AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ | |
222 | -strdup __argz_count __argz_stringify __argz_next]) | |
223 | - | |
224 | - if test "${ac_cv_func_stpcpy+set}" != "set"; then | |
225 | - AC_CHECK_FUNCS(stpcpy) | |
226 | - fi | |
227 | - if test "${ac_cv_func_stpcpy}" = "yes"; then | |
228 | - AC_DEFINE(HAVE_STPCPY) | |
229 | - fi | |
230 | - | |
231 | - AM_LC_MESSAGES | |
232 | - AM_WITH_NLS | |
233 | - | |
234 | - if test "x$CATOBJEXT" != "x"; then | |
235 | - if test "x$ALL_LINGUAS" = "x"; then | |
236 | - LINGUAS= | |
237 | - else | |
238 | - AC_MSG_CHECKING(for catalogs to be installed) | |
239 | - NEW_LINGUAS= | |
240 | - for lang in ${LINGUAS=$ALL_LINGUAS}; do | |
241 | - case "$ALL_LINGUAS" in | |
242 | - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; | |
243 | - esac | |
244 | - done | |
245 | - LINGUAS=$NEW_LINGUAS | |
246 | - AC_MSG_RESULT($LINGUAS) | |
247 | - fi | |
248 | - | |
249 | - dnl Construct list of names of catalog files to be constructed. | |
250 | - if test -n "$LINGUAS"; then | |
251 | - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done | |
252 | - fi | |
253 | - fi | |
254 | - | |
255 | - dnl The reference to <locale.h> in the installed <libintl.h> file | |
256 | - dnl must be resolved because we cannot expect the users of this | |
257 | - dnl to define HAVE_LOCALE_H. | |
258 | - if test $ac_cv_header_locale_h = yes; then | |
259 | - INCLUDE_LOCALE_H="#include <locale.h>" | |
260 | - else | |
261 | - INCLUDE_LOCALE_H="\ | |
262 | -/* The system does not provide the header <locale.h>. Take care yourself. */" | |
263 | - fi | |
264 | - AC_SUBST(INCLUDE_LOCALE_H) | |
265 | - | |
266 | - dnl Determine which catalog format we have (if any is needed) | |
267 | - dnl For now we know about two different formats: | |
268 | - dnl Linux libc-5 and the normal X/Open format | |
269 | - test -d intl || mkdir intl | |
270 | - if test "$CATOBJEXT" = ".cat"; then | |
271 | - AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) | |
272 | - | |
273 | - dnl Transform the SED scripts while copying because some dumb SEDs | |
274 | - dnl cannot handle comments. | |
275 | - sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed | |
276 | - fi | |
277 | - dnl po2tbl.sed is always needed. | |
278 | - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ | |
279 | - $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed | |
280 | - | |
281 | - dnl In the intl/Makefile.in we have a special dependency which makes | |
282 | - dnl only sense for gettext. We comment this out for non-gettext | |
283 | - dnl packages. | |
284 | - if test "$PACKAGE" = "gettext"; then | |
285 | - GT_NO="#NO#" | |
286 | - GT_YES= | |
287 | - else | |
288 | - GT_NO= | |
289 | - GT_YES="#YES#" | |
290 | - fi | |
291 | - AC_SUBST(GT_NO) | |
292 | - AC_SUBST(GT_YES) | |
293 | - | |
294 | - dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly | |
295 | - dnl find the mkinstalldirs script in another subdir but ($top_srcdir). | |
296 | - dnl Try to locate is. | |
297 | - MKINSTALLDIRS= | |
298 | - if test -n "$ac_aux_dir"; then | |
299 | - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" | |
300 | - fi | |
301 | - if test -z "$MKINSTALLDIRS"; then | |
302 | - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" | |
303 | - fi | |
304 | - AC_SUBST(MKINSTALLDIRS) | |
305 | - | |
306 | - dnl *** For now the libtool support in intl/Makefile is not for real. | |
307 | - l= | |
308 | - AC_SUBST(l) | |
309 | - | |
310 | - dnl Generate list of files to be processed by xgettext which will | |
311 | - dnl be included in po/Makefile. | |
312 | - test -d po || mkdir po | |
313 | - if test "x$srcdir" != "x."; then | |
314 | - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then | |
315 | - posrcprefix="$srcdir/" | |
316 | - else | |
317 | - posrcprefix="../$srcdir/" | |
318 | - fi | |
319 | - else | |
320 | - posrcprefix="../" | |
321 | - fi | |
322 | - rm -f po/POTFILES | |
323 | - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ | |
324 | - < $srcdir/po/POTFILES.in > po/POTFILES | |
325 | - ]) | |
326 | - | |
327 | -dnl aclocal.m4 generated automatically by aclocal 1.3 | |
328 | - | |
329 | -dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. | |
330 | -dnl This Makefile.in is free software; the Free Software Foundation | |
331 | -dnl gives unlimited permission to copy and/or distribute it, | |
332 | -dnl with or without modifications, as long as this notice is preserved. | |
333 | - | |
334 | -dnl This program is distributed in the hope that it will be useful, | |
335 | -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
336 | -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
337 | -dnl PARTICULAR PURPOSE. | |
338 | - | |
339 | -dnl macros to configure g10 | |
340 | - | |
341 | - | |
342 | -dnl WK_MSG_PRINT(STRING) | |
343 | -dnl print a message | |
344 | -dnl | |
345 | -define(WK_MSG_PRINT, | |
346 | - [ echo $ac_n "$1"" $ac_c" 1>&AC_FD_MSG | |
347 | - ]) | |
348 | - | |
349 | - | |
350 | -dnl WK_CHECK_TYPEDEF(TYPE, HAVE_NAME) | |
351 | -dnl Check whether a typedef exists and create a #define $2 if it exists | |
352 | -dnl | |
353 | -AC_DEFUN(WK_CHECK_TYPEDEF, | |
354 | - [ AC_MSG_CHECKING(for $1 typedef) | |
355 | - AC_CACHE_VAL(wk_cv_typedef_$1, | |
356 | - [AC_TRY_COMPILE([#include <stdlib.h> | |
357 | - #include <sys/types.h>], [ | |
358 | - #undef $1 | |
359 | - int a = sizeof($1); | |
360 | - ], wk_cv_typedef_$1=yes, wk_cv_typedef_$1=no )]) | |
361 | - AC_MSG_RESULT($wk_cv_typedef_$1) | |
362 | - if test "$wk_cv_typedef_$1" = yes; then | |
363 | - AC_DEFINE($2) | |
364 | - fi | |
365 | - ]) | |
366 | - | |
367 | - | |
368 | - | |
369 | -dnl WK_LINK_FILES( SRC, DEST ) | |
370 | -dnl same as AC_LINK_FILES, but collect the files to link in | |
371 | -dnl some special variables and do the link | |
372 | -dnl when WK_DO_LINK_FILES is called | |
373 | -dnl This is a workaround for AC_LINK_FILES, because it does not work | |
374 | -dnl correct when using a caching scheme | |
375 | -dnl | |
376 | -define(WK_LINK_FILES, | |
377 | - [ if test "x$wk_link_files_src" = "x"; then | |
378 | - wk_link_files_src="$1" | |
379 | - wk_link_files_dst="$2" | |
380 | - else | |
381 | - wk_link_files_src="$wk_link_files_src $1" | |
382 | - wk_link_files_dst="$wk_link_files_dst $2" | |
383 | - fi | |
384 | - ]) | |
385 | -define(WK_DO_LINK_FILES, | |
386 | - [ AC_LINK_FILES( $wk_link_files_src, $wk_link_files_dst ) | |
387 | - ]) | |
388 | - | |
389 | - | |
390 | -dnl WK_CHECK_ENDIAN | |
391 | -dnl define either LITTLE_ENDIAN_HOST or BIG_ENDIAN_HOST | |
392 | -dnl | |
393 | -define(WK_CHECK_ENDIAN, | |
394 | - [ if test "$cross_compiling" = yes; then | |
395 | - AC_MSG_WARN(cross compiling; assuming little endianess) | |
396 | - fi | |
397 | - AC_MSG_CHECKING(endianess) | |
398 | - AC_CACHE_VAL(wk_cv_c_endian, | |
399 | - [ wk_cv_c_endian=unknown | |
400 | - # See if sys/param.h defines the BYTE_ORDER macro. | |
401 | - AC_TRY_COMPILE([#include <sys/types.h> | |
402 | - #include <sys/param.h>], [ | |
403 | - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN | |
404 | - bogus endian macros | |
405 | - #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. | |
406 | - AC_TRY_COMPILE([#include <sys/types.h> | |
407 | - #include <sys/param.h>], [ | |
408 | - #if BYTE_ORDER != BIG_ENDIAN | |
409 | - not big endian | |
410 | - #endif], wk_cv_c_endian=big, wk_cv_c_endian=little)]) | |
411 | - if test "$wk_cv_c_endian" = unknown; then | |
412 | - AC_TRY_RUN([main () { | |
413 | - /* Are we little or big endian? From Harbison&Steele. */ | |
414 | - union | |
415 | - { | |
416 | - long l; | |
417 | - char c[sizeof (long)]; | |
418 | - } u; | |
419 | - u.l = 1; | |
420 | - exit (u.c[sizeof (long) - 1] == 1); | |
421 | - }], | |
422 | - wk_cv_c_endian=little, | |
423 | - wk_cv_c_endian=big, | |
424 | - wk_cv_c_endian=little | |
425 | - ) | |
426 | - fi | |
427 | - ]) | |
428 | - AC_MSG_RESULT([$wk_cv_c_endian]) | |
429 | - if test "$wk_cv_c_endian" = little; then | |
430 | - AC_DEFINE(LITTLE_ENDIAN_HOST) | |
431 | - else | |
432 | - AC_DEFINE(BIG_ENDIAN_HOST) | |
433 | - fi | |
434 | - ]) | |
435 | - | |
436 | -dnl WK_CHECK_CACHE | |
437 | -dnl | |
438 | -define(WK_CHECK_CACHE, | |
439 | - [ AC_MSG_CHECKING(cached information) | |
440 | - wk_hostcheck="$target" | |
441 | - AC_CACHE_VAL(wk_cv_hostcheck, [ wk_cv_hostcheck="$wk_hostcheck" ]) | |
442 | - if test "$wk_cv_hostcheck" != "$wk_hostcheck"; then | |
443 | - AC_MSG_RESULT(changed) | |
444 | - AC_MSG_WARN(config.cache exists!) | |
445 | - AC_MSG_ERROR(you must do 'make distclean' first to compile for | |
446 | - different target or different parameters.) | |
447 | - else | |
448 | - AC_MSG_RESULT(ok) | |
449 | - fi | |
450 | - ]) | |
451 | - | |
452 | - | |
453 | - | |
454 | - | |
455 | -# Check for SysV IPC (from GIMP) | |
456 | -# And see whether we have a SHM_LOCK (FreeBSD does not have it). | |
457 | -dnl WK_CHECK_IPC | |
458 | -dnl | |
459 | -define(WK_CHECK_IPC, | |
460 | - [ AC_CHECK_HEADERS(sys/ipc.h sys/shm.h) | |
461 | - if test "$ac_cv_header_sys_shm_h" = "yes"; then | |
462 | - AC_MSG_CHECKING(whether shmctl IPC_RMID allowes subsequent attaches) | |
463 | - AC_TRY_RUN([ | |
464 | - #include <sys/types.h> | |
465 | - #include <sys/ipc.h> | |
466 | - #include <sys/shm.h> | |
467 | - int main() | |
468 | - { | |
469 | - int id; | |
470 | - char *shmaddr; | |
471 | - id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0777); | |
472 | - if (id == -1) | |
473 | - exit (2); | |
474 | - shmaddr = shmat (id, 0, 0); | |
475 | - shmctl (id, IPC_RMID, 0); | |
476 | - if ((char*) shmat (id, 0, 0) == (char*) -1) | |
477 | - { | |
478 | - shmdt (shmaddr); | |
479 | - exit (1); | |
480 | - } | |
481 | - shmdt (shmaddr); | |
482 | - shmdt (shmaddr); | |
483 | - exit (0); | |
484 | - } | |
485 | - ], | |
486 | - AC_DEFINE(IPC_RMID_DEFERRED_RELEASE) | |
487 | - AC_MSG_RESULT(yes), | |
488 | - AC_MSG_RESULT(no), | |
489 | - AC_MSG_RESULT(assuming no)) | |
490 | - AC_MSG_CHECKING(whether SHM_LOCK is available) | |
491 | - AC_TRY_COMPILE([#include <sys/types.h> | |
492 | - #include <sys/ipc.h> | |
493 | - #include <sys/shm.h>],[ | |
494 | - int foo( int shm_id ) { shmctl(shm_id, SHM_LOCK, 0); } | |
495 | - ], | |
496 | - AC_DEFINE(IPC_HAVE_SHM_LOCK) | |
497 | - AC_MSG_RESULT(yes), | |
498 | - AC_MSG_RESULT(no)) | |
499 | - fi | |
500 | - ]) | |
501 | - | |
502 | - | |
503 | -# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock | |
504 | -# is not called from uid 0 (not tested whether uid 0 works) | |
505 | -dnl WK_CHECK_MLOCK | |
506 | -dnl | |
507 | -define(WK_CHECK_MLOCK, | |
508 | - [ AC_CHECK_FUNCS(mlock) | |
509 | - if test "$ac_cv_func_mlock" = "yes"; then | |
510 | - AC_MSG_CHECKING(whether mlock is broken) | |
511 | - AC_TRY_RUN([ | |
512 | - #include <stdlib.h> | |
513 | - #include <unistd.h> | |
514 | - #include <errno.h> | |
515 | - #include <sys/mman.h> | |
516 | - #include <sys/types.h> | |
517 | - #include <fcntl.h> | |
518 | - | |
519 | - int main() | |
520 | - { | |
521 | - char *pool; | |
522 | - int err; | |
523 | - long int pgsize = getpagesize(); | |
524 | - | |
525 | - pool = malloc( 4096 + pgsize ); | |
526 | - if( !pool ) | |
527 | - return 2; | |
528 | - pool += (pgsize - ((long int)pool % pgsize)); | |
529 | - | |
530 | - err = mlock( pool, 4096 ); | |
531 | - if( !err || errno == EPERM ) | |
532 | - return 0; /* okay */ | |
533 | - | |
534 | - return 1; /* hmmm */ | |
535 | - } | |
536 | - | |
537 | - ], | |
538 | - AC_MSG_RESULT(no), | |
539 | - AC_DEFINE(HAVE_BROKEN_MLOCK) | |
540 | - AC_MSG_RESULT(yes), | |
541 | - AC_MSG_RESULT(assuming no)) | |
542 | - fi | |
543 | - ]) | |
544 | - | |
545 | - | |
546 | - | |
547 | -# Search path for a program which passes the given test. | |
548 | -# Ulrich Drepper <drepper@cygnus.com>, 1996. | |
549 | -# | |
550 | -# This file can be copied and used freely without restrictions. It can | |
551 | -# be used in projects which are not available under the GNU Public License | |
552 | -# but which still want to provide support for the GNU gettext functionality. | |
553 | -# Please note that the actual code is *not* freely available. | |
554 | - | |
555 | -# serial 1 | |
556 | - | |
557 | -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | |
558 | -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | |
559 | -AC_DEFUN(AM_PATH_PROG_WITH_TEST, | |
560 | -[# Extract the first word of "$2", so it can be a program name with args. | |
561 | -set dummy $2; ac_word=[$]2 | |
562 | -AC_MSG_CHECKING([for $ac_word]) | |
563 | -AC_CACHE_VAL(ac_cv_path_$1, | |
564 | -[case "[$]$1" in | |
565 | - /*) | |
566 | - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | |
567 | - ;; | |
568 | - *) | |
569 | - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
570 | - for ac_dir in ifelse([$5], , $PATH, [$5]); do | |
571 | - test -z "$ac_dir" && ac_dir=. | |
572 | - if test -f $ac_dir/$ac_word; then | |
573 | - if [$3]; then | |
574 | - ac_cv_path_$1="$ac_dir/$ac_word" | |
575 | - break | |
576 | - fi | |
577 | - fi | |
578 | - done | |
579 | - IFS="$ac_save_ifs" | |
580 | -dnl If no 4th arg is given, leave the cache variable unset, | |
581 | -dnl so AC_PATH_PROGS will keep looking. | |
582 | -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | |
583 | -])dnl | |
584 | - ;; | |
585 | -esac])dnl | |
586 | -$1="$ac_cv_path_$1" | |
587 | -if test -n "[$]$1"; then | |
588 | - AC_MSG_RESULT([$]$1) | |
589 | -else | |
590 | - AC_MSG_RESULT(no) | |
591 | -fi | |
592 | -AC_SUBST($1)dnl | |
593 | -]) | |
594 | - | |
595 | -# Check whether LC_MESSAGES is available in <locale.h>. | |
596 | -# Ulrich Drepper <drepper@cygnus.com>, 1995. | |
597 | -# | |
598 | -# This file can be copied and used freely without restrictions. It can | |
599 | -# be used in projects which are not available under the GNU Public License | |
600 | -# but which still want to provide support for the GNU gettext functionality. | |
601 | -# Please note that the actual code is *not* freely available. | |
602 | - | |
603 | -# serial 1 | |
604 | - | |
605 | -AC_DEFUN(AM_LC_MESSAGES, | |
606 | - [if test $ac_cv_header_locale_h = yes; then | |
607 | - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | |
608 | - [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | |
609 | - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | |
610 | - if test $am_cv_val_LC_MESSAGES = yes; then | |
611 | - AC_DEFINE(HAVE_LC_MESSAGES) | |
612 | - fi | |
613 | - fi]) | |
614 | - | |
615 | -# Like AC_CONFIG_HEADER, but automatically create stamp file. | |
616 | - | |
617 | -AC_DEFUN(AM_CONFIG_HEADER, | |
618 | -[AC_PREREQ([2.12]) | |
619 | -AC_CONFIG_HEADER([$1]) | |
620 | -dnl When config.status generates a header, we must update the stamp-h file. | |
621 | -dnl This file resides in the same directory as the config header | |
622 | -dnl that is generated. We must strip everything past the first ":", | |
623 | -dnl and everything past the last "/". | |
624 | -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
625 | -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
626 | -<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
627 | -<<am_indx=1 | |
628 | -for am_file in <<$1>>; do | |
629 | - case " <<$>>CONFIG_HEADERS " in | |
630 | - *" <<$>>am_file "*<<)>> | |
631 | - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
632 | - ;; | |
633 | - esac | |
634 | - am_indx=`expr "<<$>>am_indx" + 1` | |
635 | -done<<>>dnl>>) | |
636 | -changequote([,]))]) | |
637 | - | |
638 | -# | |
639 | -# Check to make sure that the build environment is sane. | |
640 | -# | |
641 | - | |
642 | -AC_DEFUN(AM_SANITY_CHECK, | |
643 | -[AC_MSG_CHECKING([whether build environment is sane]) | |
644 | -# Just in case | |
645 | -sleep 1 | |
646 | -echo timestamp > conftestfile | |
647 | -# Do `set' in a subshell so we don't clobber the current shell's | |
648 | -# arguments. Must try -L first in case configure is actually a | |
649 | -# symlink; some systems play weird games with the mod time of symlinks | |
650 | -# (eg FreeBSD returns the mod time of the symlink's containing | |
651 | -# directory). | |
652 | -if ( | |
653 | - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
654 | - if test "[$]*" = "X"; then | |
655 | - # -L didn't work. | |
656 | - set X `ls -t $srcdir/configure conftestfile` | |
657 | - fi | |
658 | - if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
659 | - && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
660 | - | |
661 | - # If neither matched, then we have a broken ls. This can happen | |
662 | - # if, for instance, CONFIG_SHELL is bash and it inherits a | |
663 | - # broken ls alias from the environment. This has actually | |
664 | - # happened. Such a system could not be considered "sane". | |
665 | - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
666 | -alias in your environment]) | |
667 | - fi | |
668 | - | |
669 | - test "[$]2" = conftestfile | |
670 | - ) | |
671 | -then | |
672 | - # Ok. | |
673 | - : | |
674 | -else | |
675 | - AC_MSG_ERROR([newly created file is older than distributed files! | |
676 | -Check your system clock]) | |
677 | -fi | |
678 | -rm -f conftest* | |
679 | -AC_MSG_RESULT(yes)]) | |
680 | - | |
681 | -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
682 | -dnl The program must properly implement --version. | |
683 | -AC_DEFUN(AM_MISSING_PROG, | |
684 | -[AC_MSG_CHECKING(for working $2) | |
685 | -# Run test in a subshell; some versions of sh will print an error if | |
686 | -# an executable is not found, even if stderr is redirected. | |
687 | -# Redirect stdin to placate older versions of autoconf. Sigh. | |
688 | -if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
689 | - $1=$2 | |
690 | - AC_MSG_RESULT(found) | |
691 | -else | |
692 | - $1="$3/missing $2" | |
693 | - AC_MSG_RESULT(missing) | |
694 | -fi | |
695 | -AC_SUBST($1)]) | |
696 | - | |
697 | -# Check to see if we're running under Cygwin32, without using | |
698 | -# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes". | |
699 | -# Otherwise set it to "no". | |
700 | - | |
701 | -dnl AM_CYGWIN32() | |
702 | -AC_DEFUN(AM_CYGWIN32, | |
703 | -[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32, | |
704 | -[AC_TRY_COMPILE(,[return __CYGWIN32__;], | |
705 | -am_cv_cygwin32=yes, am_cv_cygwin32=no) | |
706 | -rm -f conftest*]) | |
707 | -CYGWIN32= | |
708 | -test "$am_cv_cygwin32" = yes && CYGWIN32=yes]) | |
709 | - | |
710 | -# Define a conditional. | |
711 | - | |
712 | -AC_DEFUN(AM_CONDITIONAL, | |
713 | -[AC_SUBST($1_TRUE) | |
714 | -AC_SUBST($1_FALSE) | |
715 | -if $2; then | |
716 | - $1_TRUE= | |
717 | - $1_FALSE='#' | |
718 | -else | |
719 | - $1_TRUE='#' | |
720 | - $1_FALSE= | |
721 | -fi]) | |
722 | - |