1 # generated automatically by aclocal 1.16.3 -*- Autoconf -*-
3 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 # ===========================================================================
16 # https://www.gnu.org/software/autoconf-archive/ax_pthread.html
17 # ===========================================================================
21 # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
25 # This macro figures out how to build C programs using POSIX threads. It
26 # sets the PTHREAD_LIBS output variable to the threads library and linker
27 # flags, and the PTHREAD_CFLAGS output variable to any special C compiler
28 # flags that are needed. (The user can also force certain compiler
29 # flags/libs to be tested by setting these environment variables.)
31 # Also sets PTHREAD_CC to any special C compiler that is needed for
32 # multi-threaded programs (defaults to the value of CC otherwise). (This
33 # is necessary on AIX to use the special cc_r compiler alias.)
35 # NOTE: You are assumed to not only compile your program with these flags,
36 # but also to link with them as well. For example, you might link with
37 # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
39 # If you are only building threaded programs, you may wish to use these
40 # variables in your default LIBS, CFLAGS, and CC:
42 # LIBS="$PTHREAD_LIBS $LIBS"
43 # CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
46 # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
47 # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
48 # that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
50 # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
51 # PTHREAD_PRIO_INHERIT symbol is defined when compiling with
54 # ACTION-IF-FOUND is a list of shell commands to run if a threads library
55 # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
56 # is not found. If ACTION-IF-FOUND is not specified, the default action
57 # will define HAVE_PTHREAD.
59 # Please let the authors know if this macro fails on any platform, or if
60 # you have any other suggestions or comments. This macro was based on work
61 # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
62 # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
63 # Alejandro Forero Cuervo to the autoconf macro repository. We are also
64 # grateful for the helpful feedback of numerous users.
66 # Updated for Autoconf 2.68 by Daniel Richard G.
70 # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
71 # Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
73 # This program is free software: you can redistribute it and/or modify it
74 # under the terms of the GNU General Public License as published by the
75 # Free Software Foundation, either version 3 of the License, or (at your
76 # option) any later version.
78 # This program is distributed in the hope that it will be useful, but
79 # WITHOUT ANY WARRANTY; without even the implied warranty of
80 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
81 # Public License for more details.
83 # You should have received a copy of the GNU General Public License along
84 # with this program. If not, see <https://www.gnu.org/licenses/>.
86 # As a special exception, the respective Autoconf Macro's copyright owner
87 # gives unlimited permission to copy, distribute and modify the configure
88 # scripts that are the output of Autoconf when processing the Macro. You
89 # need not follow the terms of the GNU General Public License when using
90 # or distributing such scripts, even though portions of the text of the
91 # Macro appear in them. The GNU General Public License (GPL) does govern
92 # all other use of the material that constitutes the Autoconf Macro.
94 # This special exception to the GPL applies to versions of the Autoconf
95 # Macro released by the Autoconf Archive. When you make and distribute a
96 # modified version of the Autoconf Macro, you may extend this special
97 # exception to the GPL to apply to your modified version as well.
101 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
102 AC_DEFUN([AX_PTHREAD], [
103 AC_REQUIRE([AC_CANONICAL_HOST])
104 AC_REQUIRE([AC_PROG_CC])
105 AC_REQUIRE([AC_PROG_SED])
109 # We used to check for pthread.h first, but this fails if pthread.h
110 # requires special compiler flags (e.g. on Tru64 or Sequent).
111 # It gets checked for in the link test anyway.
113 # First of all, check if the user has set any of the PTHREAD_LIBS,
114 # etcetera environment variables, and if threads linking works using
116 if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
117 ax_pthread_save_CC="$CC"
118 ax_pthread_save_CFLAGS="$CFLAGS"
119 ax_pthread_save_LIBS="$LIBS"
120 AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
121 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
122 LIBS="$PTHREAD_LIBS $LIBS"
123 AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
124 AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
125 AC_MSG_RESULT([$ax_pthread_ok])
126 if test "x$ax_pthread_ok" = "xno"; then
130 CC="$ax_pthread_save_CC"
131 CFLAGS="$ax_pthread_save_CFLAGS"
132 LIBS="$ax_pthread_save_LIBS"
135 # We must check for the threads library under a number of different
136 # names; the ordering is very important because some systems
137 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
138 # libraries is broken (non-POSIX).
140 # Create a list of thread flags to try. Items starting with a "-" are
141 # C compiler flags, and other items are library names, except for "none"
142 # which indicates that we try without any flags at all, and "pthread-config"
143 # which is a program returning the flags for the Pth emulation library.
145 ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
147 # The ordering *is* (sometimes) important. Some notes on the
148 # individual items follow:
150 # pthreads: AIX (must check this before -lpthread)
151 # none: in case threads are in libc; should be tried before -Kthread and
152 # other compiler flags to prevent continual compiler warnings
153 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
154 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
155 # (Note: HP C rejects this with "bad form for `-t' option")
156 # -pthreads: Solaris/gcc (Note: HP C also rejects)
157 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
158 # doesn't hurt to check since this sometimes defines pthreads and
159 # -D_REENTRANT too), HP C (must be checked before -lpthread, which
160 # is present but should not be used directly; and before -mthreads,
161 # because the compiler interprets this as "-mt" + "-hreads")
162 # -mthreads: Mingw32/gcc, Lynx/gcc
163 # pthread: Linux, etcetera
164 # --thread-safe: KAI C++
165 # pthread-config: use pthread-config program (for GNU Pth library)
171 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
172 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
174 ax_pthread_flags="-kthread lthread $ax_pthread_flags"
179 # From the cc(1) man page: "[-mt] Sets various -D flags to enable
180 # multi-threading and also sets -lpthread."
182 ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
187 # IBM z/OS requires a feature-test macro to be defined in order to
188 # enable POSIX threads at all, so give the user a hint if this is
189 # not set. (We don't define these ourselves, as they can affect
190 # other portions of the system API in unpredictable ways.)
192 AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
194 # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
195 AX_PTHREAD_ZOS_MISSING
198 [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
203 # On Solaris (at least, for some versions), libc contains stubbed
204 # (non-functional) versions of the pthreads routines, so link-based
205 # tests will erroneously succeed. (N.B.: The stubs are missing
206 # pthread_cleanup_push, or rather a function called by this macro,
207 # so we could check for that, but who knows whether they'll stub
208 # that too in a future libc.) So we'll check first for the
209 # standard Solaris way of linking pthreads (-mt -lpthread).
211 ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
215 # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
217 AS_IF([test "x$GCC" = "xyes"],
218 [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
220 # The presence of a feature test macro requesting re-entrant function
221 # definitions is, on some systems, a strong hint that pthreads support is
225 darwin* | hpux* | linux* | osf* | solaris*)
226 ax_pthread_check_macro="_REENTRANT"
230 ax_pthread_check_macro="_THREAD_SAFE"
234 ax_pthread_check_macro="--"
237 AS_IF([test "x$ax_pthread_check_macro" = "x--"],
238 [ax_pthread_check_cond=0],
239 [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
241 # Are we compiling with Clang?
243 AC_CACHE_CHECK([whether $CC is Clang],
244 [ax_cv_PTHREAD_CLANG],
245 [ax_cv_PTHREAD_CLANG=no
246 # Note that Autoconf sets GCC=yes for Clang as well as GCC
247 if test "x$GCC" = "xyes"; then
248 AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
249 [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
250 # if defined(__clang__) && defined(__llvm__)
251 AX_PTHREAD_CC_IS_CLANG
254 [ax_cv_PTHREAD_CLANG=yes])
257 ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
259 ax_pthread_clang_warning=no
261 # Clang needs special handling, because older versions handle the -pthread
262 # option in a rather... idiosyncratic way
264 if test "x$ax_pthread_clang" = "xyes"; then
266 # Clang takes -pthread; it has never supported any other flag
268 # (Note 1: This will need to be revisited if a system that Clang
269 # supports has POSIX threads in a separate library. This tends not
270 # to be the way of modern systems, but it's conceivable.)
272 # (Note 2: On some systems, notably Darwin, -pthread is not needed
273 # to get POSIX threads support; the API is always present and
274 # active. We could reasonably leave PTHREAD_CFLAGS empty. But
275 # -pthread does define _REENTRANT, and while the Darwin headers
276 # ignore this macro, third-party headers might not.)
278 PTHREAD_CFLAGS="-pthread"
283 # However, older versions of Clang make a point of warning the user
284 # that, in an invocation where only linking and no compilation is
285 # taking place, the -pthread option has no effect ("argument unused
286 # during compilation"). They expect -pthread to be passed in only
287 # when source code is being compiled.
289 # Problem is, this is at odds with the way Automake and most other
290 # C build frameworks function, which is that the same flags used in
291 # compilation (CFLAGS) are also used in linking. Many systems
292 # supported by AX_PTHREAD require exactly this for POSIX threads
293 # support, and in fact it is often not straightforward to specify a
294 # flag that is used only in the compilation phase and not in
295 # linking. Such a scenario is extremely rare in practice.
297 # Even though use of the -pthread flag in linking would only print
298 # a warning, this can be a nuisance for well-run software projects
299 # that build with -Werror. So if the active version of Clang has
300 # this misfeature, we search for an option to squash it.
302 AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
303 [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
304 [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
305 # Create an alternate version of $ac_link that compiles and
306 # links in two steps (.c -> .o, .o -> exe) instead of one
307 # (.c -> exe), because the warning occurs only in the second
309 ax_pthread_save_ac_link="$ac_link"
310 ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
311 ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
312 ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
313 ax_pthread_save_CFLAGS="$CFLAGS"
314 for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
315 AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
316 CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
317 ac_link="$ax_pthread_save_ac_link"
318 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
319 [ac_link="$ax_pthread_2step_ac_link"
320 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
324 ac_link="$ax_pthread_save_ac_link"
325 CFLAGS="$ax_pthread_save_CFLAGS"
326 AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
327 ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
330 case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
332 *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
335 fi # $ax_pthread_clang = yes
337 if test "x$ax_pthread_ok" = "xno"; then
338 for ax_pthread_try_flag in $ax_pthread_flags; do
340 case $ax_pthread_try_flag in
342 AC_MSG_CHECKING([whether pthreads work without any flags])
346 AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
348 PTHREAD_LIBS="-lpthread"
352 AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
353 PTHREAD_CFLAGS="$ax_pthread_try_flag"
357 AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
358 AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
359 PTHREAD_CFLAGS="`pthread-config --cflags`"
360 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
364 AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
365 PTHREAD_LIBS="-l$ax_pthread_try_flag"
369 ax_pthread_save_CFLAGS="$CFLAGS"
370 ax_pthread_save_LIBS="$LIBS"
371 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
372 LIBS="$PTHREAD_LIBS $LIBS"
374 # Check for various functions. We must include pthread.h,
375 # since some functions may be macros. (On the Sequent, we
376 # need a special flag -Kthread to make this header compile.)
377 # We check for pthread_join because it is in -lpthread on IRIX
378 # while pthread_create is in libc. We check for pthread_attr_init
379 # due to DEC craziness with -lpthreads. We check for
380 # pthread_cleanup_push because it is one of the few pthread
381 # functions on Solaris that doesn't have a non-functional libc stub.
382 # We try pthread_create on general principles.
384 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
385 # if $ax_pthread_check_cond
386 # error "$ax_pthread_check_macro must be defined"
388 static void routine(void *a) { a = 0; }
389 static void *start_routine(void *a) { return a; }],
390 [pthread_t th; pthread_attr_t attr;
391 pthread_create(&th, 0, start_routine, 0);
393 pthread_attr_init(&attr);
394 pthread_cleanup_push(routine, 0);
395 pthread_cleanup_pop(0) /* ; */])],
399 CFLAGS="$ax_pthread_save_CFLAGS"
400 LIBS="$ax_pthread_save_LIBS"
402 AC_MSG_RESULT([$ax_pthread_ok])
403 AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
410 # Various other checks:
411 if test "x$ax_pthread_ok" = "xyes"; then
412 ax_pthread_save_CFLAGS="$CFLAGS"
413 ax_pthread_save_LIBS="$LIBS"
414 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
415 LIBS="$PTHREAD_LIBS $LIBS"
417 # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
418 AC_CACHE_CHECK([for joinable pthread attribute],
419 [ax_cv_PTHREAD_JOINABLE_ATTR],
420 [ax_cv_PTHREAD_JOINABLE_ATTR=unknown
421 for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
422 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
423 [int attr = $ax_pthread_attr; return attr /* ; */])],
424 [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
428 AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
429 test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
430 test "x$ax_pthread_joinable_attr_defined" != "xyes"],
431 [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
432 [$ax_cv_PTHREAD_JOINABLE_ATTR],
433 [Define to necessary symbol if this constant
434 uses a non-standard name on your system.])
435 ax_pthread_joinable_attr_defined=yes
438 AC_CACHE_CHECK([whether more special flags are required for pthreads],
439 [ax_cv_PTHREAD_SPECIAL_FLAGS],
440 [ax_cv_PTHREAD_SPECIAL_FLAGS=no
443 ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
447 AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
448 test "x$ax_pthread_special_flags_added" != "xyes"],
449 [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
450 ax_pthread_special_flags_added=yes])
452 AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
453 [ax_cv_PTHREAD_PRIO_INHERIT],
454 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
455 [[int i = PTHREAD_PRIO_INHERIT;]])],
456 [ax_cv_PTHREAD_PRIO_INHERIT=yes],
457 [ax_cv_PTHREAD_PRIO_INHERIT=no])
459 AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
460 test "x$ax_pthread_prio_inherit_defined" != "xyes"],
461 [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
462 ax_pthread_prio_inherit_defined=yes
465 CFLAGS="$ax_pthread_save_CFLAGS"
466 LIBS="$ax_pthread_save_LIBS"
468 # More AIX lossage: compile with *_r variant
469 if test "x$GCC" != "xyes"; then
473 [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
474 [#handle absolute path differently from PATH based program lookup
477 [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
478 [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
484 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
486 AC_SUBST([PTHREAD_LIBS])
487 AC_SUBST([PTHREAD_CFLAGS])
488 AC_SUBST([PTHREAD_CC])
490 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
491 if test "x$ax_pthread_ok" = "xyes"; then
492 ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
501 # gettext.m4 serial 71 (gettext-0.20.2)
502 dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
503 dnl This file is free software; the Free Software Foundation
504 dnl gives unlimited permission to copy and/or distribute it,
505 dnl with or without modifications, as long as this notice is preserved.
507 dnl This file can be used in projects which are not available under
508 dnl the GNU General Public License or the GNU Lesser General Public
509 dnl License but which still want to provide support for the GNU gettext
511 dnl Please note that the actual code of the GNU gettext library is covered
512 dnl by the GNU Lesser General Public License, and the rest of the GNU
513 dnl gettext package is covered by the GNU General Public License.
514 dnl They are *not* in the public domain.
517 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
518 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
520 dnl Macro to add for using GNU gettext.
522 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
523 dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
524 dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and
525 dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
526 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
527 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
528 dnl depending on --{enable,disable}-{shared,static} and on the presence of
529 dnl AM-DISABLE-SHARED).
530 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
531 dnl implementations (in libc or libintl) without the ngettext() function
532 dnl will be ignored. If NEEDSYMBOL is specified and is
533 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
534 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
535 dnl INTLDIR is used to find the intl libraries. If empty,
536 dnl the value '$(top_builddir)/intl/' is used.
538 dnl The result of the configuration is one of three cases:
539 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
541 dnl Catalog format: GNU --> install in $(datadir)
542 dnl Catalog extension: .mo after installation, .gmo in source tree
543 dnl 2) GNU gettext has been found in the system's C library.
544 dnl Catalog format: GNU --> install in $(datadir)
545 dnl Catalog extension: .mo after installation, .gmo in source tree
546 dnl 3) No internationalization, always use English msgid.
547 dnl Catalog format: none
548 dnl Catalog extension: none
549 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
550 dnl The use of .gmo is historical (it was needed to avoid overwriting the
551 dnl GNU format catalogs when building on a platform with an X/Open gettext),
552 dnl but we keep it in order not to force irrelevant filename changes on the
555 AC_DEFUN([AM_GNU_GETTEXT],
557 dnl Argument checking.
558 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
559 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
561 ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
562 [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
564 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
565 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
567 define([gt_included_intl],
568 ifelse([$1], [external], [no], [yes]))
570 AM_GNU_GETTEXT_NEED([$2])
572 AC_REQUIRE([AM_PO_SUBDIRS])dnl
573 ifelse(gt_included_intl, yes, [
574 AC_REQUIRE([AM_INTL_SUBDIR])dnl
577 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
578 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
579 AC_REQUIRE([AC_LIB_RPATH])
581 dnl Sometimes libintl requires libiconv, so first search for libiconv.
582 dnl Ideally we would do this search only after the
583 dnl if test "$USE_NLS" = "yes"; then
584 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
585 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
586 dnl the configure script would need to contain the same shell code
587 dnl again, outside any 'if'. There are two solutions:
588 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
589 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
590 dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
591 ifelse(gt_included_intl, yes, , [
592 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
595 dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
601 ifelse(gt_included_intl, yes, [
602 BUILD_INCLUDED_LIBINTL=no
603 USE_INCLUDED_LIBINTL=no
609 dnl Add a version number to the cache macros.
610 case " $gt_needs " in
611 *" need-formatstring-macros "*) gt_api_version=3 ;;
612 *" need-ngettext "*) gt_api_version=2 ;;
613 *) gt_api_version=1 ;;
615 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
616 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
618 dnl If we use NLS figure out what method
619 if test "$USE_NLS" = "yes"; then
620 gt_use_preinstalled_gnugettext=no
621 ifelse(gt_included_intl, yes, [
622 AC_MSG_CHECKING([whether included gettext is requested])
623 AC_ARG_WITH([included-gettext],
624 [ --with-included-gettext use the GNU gettext library included here],
625 nls_cv_force_use_gnu_gettext=$withval,
626 nls_cv_force_use_gnu_gettext=no)
627 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
629 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
630 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
632 dnl User does not insist on using GNU NLS library. Figure out what
633 dnl to use. If GNU gettext is available we use this. Else we have
634 dnl to fall back to GNU NLS library.
636 if test $gt_api_version -ge 3; then
637 gt_revision_test_code='
638 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
639 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
642 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
646 gt_revision_test_code=
648 if test $gt_api_version -ge 2; then
649 gt_expression_test_code=' + * ngettext ("", "", 0)'
651 gt_expression_test_code=
654 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
659 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
660 extern int _nl_msg_cat_cntr;
661 extern int *_nl_domain_bindings;
662 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
664 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
666 $gt_revision_test_code
669 bindtextdomain ("", "");
670 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
672 [eval "$gt_func_gnugettext_libc=yes"],
673 [eval "$gt_func_gnugettext_libc=no"])])
675 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
676 dnl Sometimes libintl requires libiconv, so first search for libiconv.
677 ifelse(gt_included_intl, yes, , [
680 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
681 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
682 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
683 dnl even if libiconv doesn't exist.
684 AC_LIB_LINKFLAGS_BODY([intl])
685 AC_CACHE_CHECK([for GNU gettext in libintl],
686 [$gt_func_gnugettext_libintl],
687 [gt_save_CPPFLAGS="$CPPFLAGS"
688 CPPFLAGS="$CPPFLAGS $INCINTL"
690 LIBS="$LIBS $LIBINTL"
691 dnl Now see whether libintl exists and does not depend on libiconv.
696 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
697 extern int _nl_msg_cat_cntr;
702 const char *_nl_expand_alias (const char *);
703 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
705 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
707 $gt_revision_test_code
710 bindtextdomain ("", "");
711 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
713 [eval "$gt_func_gnugettext_libintl=yes"],
714 [eval "$gt_func_gnugettext_libintl=no"])
715 dnl Now see whether libintl exists and depends on libiconv.
716 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
717 LIBS="$LIBS $LIBICONV"
722 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
723 extern int _nl_msg_cat_cntr;
728 const char *_nl_expand_alias (const char *);
729 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
731 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
733 $gt_revision_test_code
736 bindtextdomain ("", "");
737 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
739 [LIBINTL="$LIBINTL $LIBICONV"
740 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
741 eval "$gt_func_gnugettext_libintl=yes"
744 CPPFLAGS="$gt_save_CPPFLAGS"
745 LIBS="$gt_save_LIBS"])
748 dnl If an already present or preinstalled GNU gettext() is found,
749 dnl use it. But if this macro is used in GNU gettext, and GNU
750 dnl gettext is already preinstalled in libintl, we update this
751 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
752 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
753 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
754 && test "$PACKAGE" != gettext-runtime \
755 && test "$PACKAGE" != gettext-tools; }; then
756 gt_use_preinstalled_gnugettext=yes
758 dnl Reset the values set by searching for libintl.
764 ifelse(gt_included_intl, yes, [
765 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
766 dnl GNU gettext is not found in the C library.
767 dnl Fall back on included GNU gettext library.
768 nls_cv_use_gnu_gettext=yes
772 if test "$nls_cv_use_gnu_gettext" = "yes"; then
773 dnl Mark actions used to generate GNU NLS library.
774 BUILD_INCLUDED_LIBINTL=yes
775 USE_INCLUDED_LIBINTL=yes
776 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
777 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
778 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
782 if test "$gt_use_preinstalled_gnugettext" = "yes" \
783 || test "$nls_cv_use_gnu_gettext" = "yes"; then
784 dnl Mark actions to use GNU gettext tools.
789 if test -n "$INTL_MACOSX_LIBS"; then
790 if test "$gt_use_preinstalled_gnugettext" = "yes" \
791 || test "$nls_cv_use_gnu_gettext" = "yes"; then
792 dnl Some extra flags are needed during linking.
793 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
794 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
798 if test "$gt_use_preinstalled_gnugettext" = "yes" \
799 || test "$nls_cv_use_gnu_gettext" = "yes"; then
800 AC_DEFINE([ENABLE_NLS], [1],
801 [Define to 1 if translation of program messages to the user's native language
808 AC_MSG_CHECKING([whether to use NLS])
809 AC_MSG_RESULT([$USE_NLS])
810 if test "$USE_NLS" = "yes"; then
811 AC_MSG_CHECKING([where the gettext function comes from])
812 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
813 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
814 gt_source="external libintl"
819 gt_source="included intl directory"
821 AC_MSG_RESULT([$gt_source])
824 if test "$USE_NLS" = "yes"; then
826 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
827 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
828 AC_MSG_CHECKING([how to link with libintl])
829 AC_MSG_RESULT([$LIBINTL])
830 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
833 dnl For backward compatibility. Some packages may be using this.
834 AC_DEFINE([HAVE_GETTEXT], [1],
835 [Define if the GNU gettext() function is already present or preinstalled.])
836 AC_DEFINE([HAVE_DCGETTEXT], [1],
837 [Define if the GNU dcgettext() function is already present or preinstalled.])
840 dnl We need to process the po/ directory.
844 ifelse(gt_included_intl, yes, [
845 dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
846 dnl because some of the testsuite requires it.
847 BUILD_INCLUDED_LIBINTL=yes
849 dnl Make all variables we use known to autoconf.
850 AC_SUBST([BUILD_INCLUDED_LIBINTL])
851 AC_SUBST([USE_INCLUDED_LIBINTL])
852 AC_SUBST([CATOBJEXT])
855 dnl For backward compatibility. Some Makefiles may be using this.
859 dnl Make all documented variables known to autoconf.
861 AC_SUBST([LTLIBINTL])
866 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
867 m4_define([gt_NEEDS_INIT],
869 m4_divert_text([DEFAULTS], [gt_needs=])
870 m4_define([gt_NEEDS_INIT], [])
874 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
875 AC_DEFUN([AM_GNU_GETTEXT_NEED],
877 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
881 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
882 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
885 dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
886 AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
888 # host-cpu-c-abi.m4 serial 13
889 dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
890 dnl This file is free software; the Free Software Foundation
891 dnl gives unlimited permission to copy and/or distribute it,
892 dnl with or without modifications, as long as this notice is preserved.
894 dnl From Bruno Haible and Sam Steingold.
896 dnl Sets the HOST_CPU variable to the canonical name of the CPU.
897 dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
898 dnl C language ABI (application binary interface).
899 dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
902 dnl This canonical name can be used to select a particular assembly language
903 dnl source file that will interoperate with C code on the given host.
906 dnl * 'i386' and 'sparc' are different canonical names, because code for i386
907 dnl will not run on SPARC CPUs and vice versa. They have different
908 dnl instruction sets.
909 dnl * 'sparc' and 'sparc64' are different canonical names, because code for
910 dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
911 dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
912 dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
913 dnl mode, but not both.
914 dnl * 'mips' and 'mipsn32' are different canonical names, because they use
915 dnl different argument passing and return conventions for C functions, and
916 dnl although the instruction set of 'mips' is a large subset of the
917 dnl instruction set of 'mipsn32'.
918 dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
919 dnl different sizes for the C types like 'int' and 'void *', and although
920 dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
921 dnl * The same canonical name is used for different endiannesses. You can
922 dnl determine the endianness through preprocessor symbols:
923 dnl - 'arm': test __ARMEL__.
924 dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
925 dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
926 dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
927 dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
928 dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
929 dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
930 dnl assembly language source files use such instructions, you will
931 dnl need to make the distinction.
932 dnl - Speed of execution of the common instruction set is reasonable across
933 dnl the entire family of CPUs. If you have assembly language source files
934 dnl that are optimized for particular CPU types (like GNU gmp has), you
935 dnl will need to make the distinction.
936 dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
937 AC_DEFUN([gl_HOST_CPU_C_ABI],
939 AC_REQUIRE([AC_CANONICAL_HOST])
940 AC_REQUIRE([gl_C_ASM])
941 AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
947 gl_cv_host_cpu_c_abi=i386
951 # On x86_64 systems, the C compiler may be generating code in one of
953 # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
954 # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
955 # with native Windows (mingw, MSVC).
956 # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
957 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
960 [[#if (defined __x86_64__ || defined __amd64__ \
961 || defined _M_X64 || defined _M_AMD64)
969 [[#if defined __ILP32__ || defined _ILP32
975 [gl_cv_host_cpu_c_abi=x86_64-x32],
976 [gl_cv_host_cpu_c_abi=x86_64])],
977 [gl_cv_host_cpu_c_abi=i386])
981 alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
983 gl_cv_host_cpu_c_abi=alpha
987 # Assume arm with EABI.
988 # On arm64 systems, the C compiler may be generating code in one of
990 # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
991 # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
992 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
1003 [[#if defined __ILP32__ || defined _ILP32
1009 [gl_cv_host_cpu_c_abi=arm64-ilp32],
1010 [gl_cv_host_cpu_c_abi=arm64])],
1011 [# Don't distinguish little-endian and big-endian arm, since they
1012 # don't require different machine code for simple operations and
1013 # since the user can distinguish them through the preprocessor
1014 # defines __ARMEL__ vs. __ARMEB__.
1015 # But distinguish arm which passes floating-point arguments and
1016 # return values in integer registers (r0, r1, ...) - this is
1017 # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
1018 # passes them in float registers (s0, s1, ...) and double registers
1019 # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
1020 # sets the preprocessor defines __ARM_PCS (for the first case) and
1021 # __ARM_PCS_VFP (for the second case), but older GCC does not.
1022 echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
1023 # Look for a reference to the register d0 in the .s file.
1024 AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
1025 if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
1026 gl_cv_host_cpu_c_abi=armhf
1028 gl_cv_host_cpu_c_abi=arm
1034 hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
1035 # On hppa, the C compiler may be generating 32-bit code or 64-bit
1036 # code. In the latter case, it defines _LP64 and __LP64__.
1045 [gl_cv_host_cpu_c_abi=hppa64],
1046 [gl_cv_host_cpu_c_abi=hppa])
1050 # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
1051 # 32-bit code. In the latter case, it defines _ILP32.
1060 [gl_cv_host_cpu_c_abi=ia64-ilp32],
1061 [gl_cv_host_cpu_c_abi=ia64])
1065 # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
1069 [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
1075 [gl_cv_host_cpu_c_abi=mips64],
1076 [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
1077 # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
1078 # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
1079 # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
1082 [[#if (_MIPS_SIM == _ABIN32)
1088 [gl_cv_host_cpu_c_abi=mipsn32],
1089 [gl_cv_host_cpu_c_abi=mips])])
1093 # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
1094 # No need to distinguish them here; the caller may distinguish
1095 # them based on the OS.
1096 # On powerpc64 systems, the C compiler may still be generating
1097 # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
1098 # be generating 64-bit code.
1101 [[#if defined __powerpc64__ || defined _ARCH_PPC64
1107 [# On powerpc64, there are two ABIs on Linux: The AIX compatible
1108 # one and the ELFv2 one. The latter defines _CALL_ELF=2.
1111 [[#if defined _CALL_ELF && _CALL_ELF == 2
1117 [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
1118 [gl_cv_host_cpu_c_abi=powerpc64])
1120 [gl_cv_host_cpu_c_abi=powerpc])
1124 gl_cv_host_cpu_c_abi=powerpc
1128 # There are 2 architectures (with variants): rv32* and rv64*.
1131 [[#if __riscv_xlen == 64
1139 # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
1140 # Size of 'long' and 'void *':
1143 [[#if defined __LP64__
1152 # __riscv_float_abi_double:
1153 # 'float' and 'double' are passed in floating-point registers.
1154 # __riscv_float_abi_single:
1155 # 'float' are passed in floating-point registers.
1156 # __riscv_float_abi_soft:
1157 # No values are passed in floating-point registers.
1160 [[#if defined __riscv_float_abi_double
1169 [[#if defined __riscv_float_abi_single
1178 gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
1182 # On s390x, the C compiler may be generating 64-bit (= s390x) code
1183 # or 31-bit (= s390) code.
1186 [[#if defined __LP64__ || defined __s390x__
1192 [gl_cv_host_cpu_c_abi=s390x],
1193 [gl_cv_host_cpu_c_abi=s390])
1197 # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
1198 # C compiler still generates 32-bit code.
1201 [[#if defined __sparcv9 || defined __arch64__
1207 [gl_cv_host_cpu_c_abi=sparc64],
1208 [gl_cv_host_cpu_c_abi=sparc])
1212 gl_cv_host_cpu_c_abi="$host_cpu"
1217 dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
1218 HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
1219 HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
1220 AC_SUBST([HOST_CPU])
1221 AC_SUBST([HOST_CPU_C_ABI])
1224 # AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
1225 # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
1226 # earlier, but KAI C++ 3.2d doesn't like this.
1227 sed -e 's/-/_/g' >> confdefs.h <<EOF
1228 #ifndef __${HOST_CPU}__
1229 #define __${HOST_CPU}__ 1
1231 #ifndef __${HOST_CPU_C_ABI}__
1232 #define __${HOST_CPU_C_ABI}__ 1
1235 AH_TOP([/* CPU and C ABI indicator */
1239 #ifndef __x86_64_x32__
1240 #undef __x86_64_x32__
1254 #ifndef __arm64_ilp32__
1255 #undef __arm64_ilp32__
1266 #ifndef __ia64_ilp32__
1267 #undef __ia64_ilp32__
1287 #ifndef __powerpc64__
1288 #undef __powerpc64__
1290 #ifndef __powerpc64_elfv2__
1291 #undef __powerpc64_elfv2__
1299 #ifndef __riscv32_ilp32__
1300 #undef __riscv32_ilp32__
1302 #ifndef __riscv32_ilp32f__
1303 #undef __riscv32_ilp32f__
1305 #ifndef __riscv32_ilp32d__
1306 #undef __riscv32_ilp32d__
1308 #ifndef __riscv64_ilp32__
1309 #undef __riscv64_ilp32__
1311 #ifndef __riscv64_ilp32f__
1312 #undef __riscv64_ilp32f__
1314 #ifndef __riscv64_ilp32d__
1315 #undef __riscv64_ilp32d__
1317 #ifndef __riscv64_lp64__
1318 #undef __riscv64_lp64__
1320 #ifndef __riscv64_lp64f__
1321 #undef __riscv64_lp64f__
1323 #ifndef __riscv64_lp64d__
1324 #undef __riscv64_lp64d__
1346 dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
1347 dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
1348 dnl one, or to 'unknown' if unknown.
1349 dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
1350 AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
1352 AC_REQUIRE([AC_CANONICAL_HOST])
1353 AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
1354 [if test -n "$gl_cv_host_cpu_c_abi"; then
1355 case "$gl_cv_host_cpu_c_abi" in
1356 i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
1357 gl_cv_host_cpu_c_abi_32bit=yes ;;
1358 x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
1359 gl_cv_host_cpu_c_abi_32bit=no ;;
1361 gl_cv_host_cpu_c_abi_32bit=unknown ;;
1366 # CPUs that only support a 32-bit ABI.
1375 | microblaze | microblazeel \
1376 | nds32 | nds32le | nds32be \
1377 | nios2 | nios2eb | nios2el \
1380 | sh | sh[1234] | sh[1234]e[lb] \
1383 gl_cv_host_cpu_c_abi_32bit=yes
1386 # CPUs that only support a 64-bit ABI.
1388 alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
1391 gl_cv_host_cpu_c_abi_32bit=no
1397 gl_cv_host_cpu_c_abi_32bit=yes
1401 # On x86_64 systems, the C compiler may be generating code in one of
1403 # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
1404 # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
1405 # with native Windows (mingw, MSVC).
1406 # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
1407 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
1410 [[#if (defined __x86_64__ || defined __amd64__ \
1411 || defined _M_X64 || defined _M_AMD64) \
1412 && !(defined __ILP32__ || defined _ILP32)
1418 [gl_cv_host_cpu_c_abi_32bit=no],
1419 [gl_cv_host_cpu_c_abi_32bit=yes])
1423 # Assume arm with EABI.
1424 # On arm64 systems, the C compiler may be generating code in one of
1426 # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
1427 # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
1428 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
1431 [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
1437 [gl_cv_host_cpu_c_abi_32bit=no],
1438 [gl_cv_host_cpu_c_abi_32bit=yes])
1441 hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
1442 # On hppa, the C compiler may be generating 32-bit code or 64-bit
1443 # code. In the latter case, it defines _LP64 and __LP64__.
1452 [gl_cv_host_cpu_c_abi_32bit=no],
1453 [gl_cv_host_cpu_c_abi_32bit=yes])
1457 # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
1458 # 32-bit code. In the latter case, it defines _ILP32.
1467 [gl_cv_host_cpu_c_abi_32bit=yes],
1468 [gl_cv_host_cpu_c_abi_32bit=no])
1472 # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
1476 [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
1482 [gl_cv_host_cpu_c_abi_32bit=no],
1483 [gl_cv_host_cpu_c_abi_32bit=yes])
1487 # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
1488 # No need to distinguish them here; the caller may distinguish
1489 # them based on the OS.
1490 # On powerpc64 systems, the C compiler may still be generating
1491 # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
1492 # be generating 64-bit code.
1495 [[#if defined __powerpc64__ || defined _ARCH_PPC64
1501 [gl_cv_host_cpu_c_abi_32bit=no],
1502 [gl_cv_host_cpu_c_abi_32bit=yes])
1506 gl_cv_host_cpu_c_abi_32bit=yes
1510 # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
1511 # Size of 'long' and 'void *':
1514 [[#if defined __LP64__
1520 [gl_cv_host_cpu_c_abi_32bit=no],
1521 [gl_cv_host_cpu_c_abi_32bit=yes])
1525 # On s390x, the C compiler may be generating 64-bit (= s390x) code
1526 # or 31-bit (= s390) code.
1529 [[#if defined __LP64__ || defined __s390x__
1535 [gl_cv_host_cpu_c_abi_32bit=no],
1536 [gl_cv_host_cpu_c_abi_32bit=yes])
1540 # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
1541 # C compiler still generates 32-bit code.
1544 [[#if defined __sparcv9 || defined __arch64__
1550 [gl_cv_host_cpu_c_abi_32bit=no],
1551 [gl_cv_host_cpu_c_abi_32bit=yes])
1555 gl_cv_host_cpu_c_abi_32bit=unknown
1561 HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
1564 # iconv.m4 serial 21
1565 dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
1567 dnl This file is free software; the Free Software Foundation
1568 dnl gives unlimited permission to copy and/or distribute it,
1569 dnl with or without modifications, as long as this notice is preserved.
1571 dnl From Bruno Haible.
1573 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1575 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1576 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1577 AC_REQUIRE([AC_LIB_RPATH])
1579 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1581 AC_LIB_LINKFLAGS_BODY([iconv])
1584 AC_DEFUN([AM_ICONV_LINK],
1586 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1587 dnl those with the standalone portable GNU libiconv installed).
1588 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1590 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1592 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1594 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
1595 dnl because if the user has installed libiconv and not disabled its use
1596 dnl via --without-libiconv-prefix, he wants to use it. The first
1597 dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
1598 am_save_CPPFLAGS="$CPPFLAGS"
1599 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
1601 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
1602 am_cv_func_iconv="no, consider installing GNU libiconv"
1610 [[iconv_t cd = iconv_open("","");
1611 iconv(cd,NULL,NULL,NULL,NULL);
1612 iconv_close(cd);]])],
1613 [am_cv_func_iconv=yes])
1614 if test "$am_cv_func_iconv" != yes; then
1615 am_save_LIBS="$LIBS"
1616 LIBS="$LIBS $LIBICONV"
1623 [[iconv_t cd = iconv_open("","");
1624 iconv(cd,NULL,NULL,NULL,NULL);
1625 iconv_close(cd);]])],
1626 [am_cv_lib_iconv=yes]
1627 [am_cv_func_iconv=yes])
1628 LIBS="$am_save_LIBS"
1631 if test "$am_cv_func_iconv" = yes; then
1632 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
1633 dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
1635 am_save_LIBS="$LIBS"
1636 if test $am_cv_lib_iconv = yes; then
1637 LIBS="$LIBS $LIBICONV"
1639 am_cv_func_iconv_works=no
1640 for ac_iconv_const in '' 'const'; do
1648 # define ICONV_CONST $ac_iconv_const
1652 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
1655 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
1656 if (cd_utf8_to_88591 != (iconv_t)(-1))
1658 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
1660 ICONV_CONST char *inptr = input;
1661 size_t inbytesleft = strlen (input);
1663 size_t outbytesleft = sizeof (buf);
1664 size_t res = iconv (cd_utf8_to_88591,
1665 &inptr, &inbytesleft,
1666 &outptr, &outbytesleft);
1669 iconv_close (cd_utf8_to_88591);
1672 /* Test against Solaris 10 bug: Failures are not distinguishable from
1673 successful returns. */
1675 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
1676 if (cd_ascii_to_88591 != (iconv_t)(-1))
1678 static ICONV_CONST char input[] = "\263";
1680 ICONV_CONST char *inptr = input;
1681 size_t inbytesleft = strlen (input);
1683 size_t outbytesleft = sizeof (buf);
1684 size_t res = iconv (cd_ascii_to_88591,
1685 &inptr, &inbytesleft,
1686 &outptr, &outbytesleft);
1689 iconv_close (cd_ascii_to_88591);
1692 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
1694 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
1695 if (cd_88591_to_utf8 != (iconv_t)(-1))
1697 static ICONV_CONST char input[] = "\304";
1698 static char buf[2] = { (char)0xDE, (char)0xAD };
1699 ICONV_CONST char *inptr = input;
1700 size_t inbytesleft = 1;
1702 size_t outbytesleft = 1;
1703 size_t res = iconv (cd_88591_to_utf8,
1704 &inptr, &inbytesleft,
1705 &outptr, &outbytesleft);
1706 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
1708 iconv_close (cd_88591_to_utf8);
1711 #if 0 /* This bug could be worked around by the caller. */
1712 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
1714 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
1715 if (cd_88591_to_utf8 != (iconv_t)(-1))
1717 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
1719 ICONV_CONST char *inptr = input;
1720 size_t inbytesleft = strlen (input);
1722 size_t outbytesleft = sizeof (buf);
1723 size_t res = iconv (cd_88591_to_utf8,
1724 &inptr, &inbytesleft,
1725 &outptr, &outbytesleft);
1728 iconv_close (cd_88591_to_utf8);
1732 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
1735 /* Try standardized names. */
1736 iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
1737 /* Try IRIX, OSF/1 names. */
1738 iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
1739 /* Try AIX names. */
1740 iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
1741 /* Try HP-UX names. */
1742 iconv_t cd4 = iconv_open ("utf8", "eucJP");
1743 if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
1744 && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
1746 if (cd1 != (iconv_t)(-1))
1748 if (cd2 != (iconv_t)(-1))
1750 if (cd3 != (iconv_t)(-1))
1752 if (cd4 != (iconv_t)(-1))
1757 [am_cv_func_iconv_works=yes], ,
1759 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
1760 *) am_cv_func_iconv_works="guessing yes" ;;
1762 test "$am_cv_func_iconv_works" = no || break
1764 LIBS="$am_save_LIBS"
1766 case "$am_cv_func_iconv_works" in
1767 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
1768 *) am_func_iconv=yes ;;
1771 am_func_iconv=no am_cv_lib_iconv=no
1773 if test "$am_func_iconv" = yes; then
1774 AC_DEFINE([HAVE_ICONV], [1],
1775 [Define if you have the iconv() function and it works.])
1777 if test "$am_cv_lib_iconv" = yes; then
1778 AC_MSG_CHECKING([how to link with libiconv])
1779 AC_MSG_RESULT([$LIBICONV])
1781 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1783 CPPFLAGS="$am_save_CPPFLAGS"
1787 AC_SUBST([LIBICONV])
1788 AC_SUBST([LTLIBICONV])
1791 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
1792 dnl avoid warnings like
1793 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
1794 dnl This is tricky because of the way 'aclocal' is implemented:
1795 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
1796 dnl Otherwise aclocal's initial scan pass would miss the macro definition.
1797 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
1798 dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
1800 m4_define([gl_iconv_AC_DEFUN],
1801 m4_version_prereq([2.64],
1804 [m4_ifdef([gl_00GNULIB],
1809 gl_iconv_AC_DEFUN([AM_ICONV],
1812 if test "$am_cv_func_iconv" = yes; then
1813 AC_MSG_CHECKING([for iconv declaration])
1814 AC_CACHE_VAL([am_cv_proto_iconv], [
1824 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
1825 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1831 [am_cv_proto_iconv_arg1=""],
1832 [am_cv_proto_iconv_arg1="const"])
1833 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
1834 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1836 $am_cv_proto_iconv])
1838 dnl When compiling GNU libiconv on a system that does not have iconv yet,
1839 dnl pick the POSIX compliant declaration without 'const'.
1840 am_cv_proto_iconv_arg1=""
1842 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
1843 [Define as const if the declaration of iconv() needs const.])
1844 dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
1845 m4_ifdef([gl_ICONV_H_DEFAULTS],
1846 [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
1847 if test -n "$am_cv_proto_iconv_arg1"; then
1853 # intlmacosx.m4 serial 8 (gettext-0.20.2)
1854 dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc.
1855 dnl This file is free software; the Free Software Foundation
1856 dnl gives unlimited permission to copy and/or distribute it,
1857 dnl with or without modifications, as long as this notice is preserved.
1859 dnl This file can be used in projects which are not available under
1860 dnl the GNU General Public License or the GNU Lesser General Public
1861 dnl License but which still want to provide support for the GNU gettext
1863 dnl Please note that the actual code of the GNU gettext library is covered
1864 dnl by the GNU Lesser General Public License, and the rest of the GNU
1865 dnl gettext package is covered by the GNU General Public License.
1866 dnl They are *not* in the public domain.
1868 dnl Checks for special options needed on Mac OS X.
1869 dnl Defines INTL_MACOSX_LIBS.
1870 AC_DEFUN([gt_INTL_MACOSX],
1872 dnl Check for API introduced in Mac OS X 10.4.
1873 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1874 [gt_cv_func_CFPreferencesCopyAppValue],
1875 [gt_save_LIBS="$LIBS"
1876 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1879 [[#include <CoreFoundation/CFPreferences.h>]],
1880 [[CFPreferencesCopyAppValue(NULL, NULL)]])],
1881 [gt_cv_func_CFPreferencesCopyAppValue=yes],
1882 [gt_cv_func_CFPreferencesCopyAppValue=no])
1883 LIBS="$gt_save_LIBS"])
1884 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1885 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
1886 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1888 dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
1889 dnl because in macOS 10.13.4 it has the following behaviour:
1890 dnl When two or more languages are specified in the
1891 dnl "System Preferences > Language & Region > Preferred Languages" panel,
1892 dnl it returns en_CC where CC is the territory (even when English is not among
1893 dnl the preferred languages!). What we want instead is what
1894 dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
1895 dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
1896 dnl first among the preferred languages and CC is the territory.
1897 AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
1898 [gt_save_LIBS="$LIBS"
1899 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1902 [[#include <CoreFoundation/CFLocale.h>]],
1903 [[CFLocaleCopyPreferredLanguages();]])],
1904 [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
1905 [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
1906 LIBS="$gt_save_LIBS"])
1907 if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
1908 AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
1909 [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
1912 if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
1913 || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
1914 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1916 AC_SUBST([INTL_MACOSX_LIBS])
1919 # lib-ld.m4 serial 9
1920 dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc.
1921 dnl This file is free software; the Free Software Foundation
1922 dnl gives unlimited permission to copy and/or distribute it,
1923 dnl with or without modifications, as long as this notice is preserved.
1925 dnl Subroutines of libtool.m4,
1926 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
1927 dnl collision with libtool.m4.
1929 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
1930 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1931 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
1932 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
1933 case `$LD -v 2>&1 </dev/null` in
1934 *GNU* | *'with BFD'*)
1935 acl_cv_prog_gnu_ld=yes
1938 acl_cv_prog_gnu_ld=no
1941 with_gnu_ld=$acl_cv_prog_gnu_ld
1944 dnl From libtool-2.4. Sets the variable LD.
1945 AC_DEFUN([AC_LIB_PROG_LD],
1946 [AC_REQUIRE([AC_PROG_CC])dnl
1947 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1949 AC_ARG_WITH([gnu-ld],
1950 [AS_HELP_STRING([--with-gnu-ld],
1951 [assume the C compiler uses GNU ld [default=no]])],
1952 [test "$withval" = no || with_gnu_ld=yes],
1953 [with_gnu_ld=no])dnl
1955 # Prepare PATH_SEPARATOR.
1956 # The user is always right.
1957 if test "${PATH_SEPARATOR+set}" != set; then
1958 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
1959 # contains only /bin. Note that ksh looks also at the FPATH variable,
1960 # so we have to set that as well for the test.
1962 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1963 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1964 || PATH_SEPARATOR=';'
1968 if test -n "$LD"; then
1969 AC_MSG_CHECKING([for ld])
1970 elif test "$GCC" = yes; then
1971 AC_MSG_CHECKING([for ld used by $CC])
1972 elif test "$with_gnu_ld" = yes; then
1973 AC_MSG_CHECKING([for GNU ld])
1975 AC_MSG_CHECKING([for non-GNU ld])
1977 if test -n "$LD"; then
1978 # Let the user override the test with a path.
1981 AC_CACHE_VAL([acl_cv_path_LD],
1983 acl_cv_path_LD= # Final result of this test
1984 ac_prog=ld # Program to search in $PATH
1985 if test "$GCC" = yes; then
1986 # Check if gcc -print-prog-name=ld gives a path.
1989 # gcc leaves a trailing carriage return which upsets mingw
1990 acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1992 acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
1995 # Accept absolute paths.
1996 [[\\/]]* | ?:[[\\/]]*)
1997 re_direlt='/[[^/]][[^/]]*/\.\./'
1998 # Canonicalize the pathname of ld
1999 acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
2000 while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
2001 acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
2003 # Got the pathname. No search in PATH is needed.
2004 acl_cv_path_LD="$acl_output"
2008 # If it fails, then pretend we aren't using GCC.
2011 # If it is relative, then search for the first ld in PATH.
2016 if test -n "$ac_prog"; then
2017 # Search for $ac_prog in $PATH.
2018 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2019 for ac_dir in $PATH; do
2021 test -z "$ac_dir" && ac_dir=.
2022 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2023 acl_cv_path_LD="$ac_dir/$ac_prog"
2024 # Check to see if the program is GNU ld. I'd rather use --version,
2025 # but apparently some variants of GNU ld only accept -v.
2026 # Break only if it was the GNU/non-GNU ld that we prefer.
2027 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
2028 *GNU* | *'with BFD'*)
2029 test "$with_gnu_ld" != no && break
2032 test "$with_gnu_ld" != yes && break
2043 [[#if defined __powerpc64__ || defined _ARCH_PPC64
2049 [# The compiler produces 64-bit code. Add option '-b64' so that the
2050 # linker groks 64-bit object files.
2051 case "$acl_cv_path_LD " in
2053 *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
2060 [[#if defined __sparcv9 || defined __arch64__
2067 [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
2068 # so that the linker groks 32-bit object files.
2069 case "$acl_cv_path_LD " in
2070 *" -m elf32_sparc "*) ;;
2071 *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
2077 LD="$acl_cv_path_LD"
2079 if test -n "$LD"; then
2080 AC_MSG_RESULT([$LD])
2083 AC_MSG_ERROR([no acceptable ld found in \$PATH])
2088 # lib-link.m4 serial 31
2089 dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
2090 dnl This file is free software; the Free Software Foundation
2091 dnl gives unlimited permission to copy and/or distribute it,
2092 dnl with or without modifications, as long as this notice is preserved.
2094 dnl From Bruno Haible.
2098 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
2099 dnl the libraries corresponding to explicit and implicit dependencies.
2100 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
2101 dnl augments the CPPFLAGS variable.
2102 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
2103 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2104 AC_DEFUN([AC_LIB_LINKFLAGS],
2106 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2107 AC_REQUIRE([AC_LIB_RPATH])
2108 pushdef([Name],[m4_translit([$1],[./+-], [____])])
2109 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2110 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2111 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
2112 AC_LIB_LINKFLAGS_BODY([$1], [$2])
2113 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
2114 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
2115 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
2116 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
2118 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
2119 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
2120 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
2121 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
2122 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2124 AC_SUBST([LTLIB]NAME)
2125 AC_SUBST([LIB]NAME[_PREFIX])
2126 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
2127 dnl results of this search when this library appears as a dependency.
2133 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
2134 dnl searches for libname and the libraries corresponding to explicit and
2135 dnl implicit dependencies, together with the specified include files and
2136 dnl the ability to compile and link the specified testcode. The missing-message
2137 dnl defaults to 'no' and may contain additional hints for the user.
2138 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
2139 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2140 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2141 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2142 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
2143 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2144 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2146 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2147 AC_REQUIRE([AC_LIB_RPATH])
2148 pushdef([Name],[m4_translit([$1],[./+-], [____])])
2149 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2150 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2152 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2154 AC_LIB_LINKFLAGS_BODY([$1], [$2])
2156 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2157 dnl because if the user has installed lib[]Name and not disabled its use
2158 dnl via --without-lib[]Name-prefix, he wants to use it.
2159 ac_save_CPPFLAGS="$CPPFLAGS"
2160 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2162 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2163 ac_save_LIBS="$LIBS"
2164 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
2165 dnl because these -l options might require -L options that are present in
2166 dnl LIBS. -l options benefit only from the -L options listed before it.
2167 dnl Otherwise, add it to the front of LIBS, because it may be a static
2168 dnl library that depends on another static library that is present in LIBS.
2169 dnl Static libraries benefit only from the static libraries listed after
2171 case " $LIB[]NAME" in
2172 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
2173 *) LIBS="$LIB[]NAME $LIBS" ;;
2176 [AC_LANG_PROGRAM([[$3]], [[$4]])],
2177 [ac_cv_lib[]Name=yes],
2178 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
2179 LIBS="$ac_save_LIBS"
2181 if test "$ac_cv_lib[]Name" = yes; then
2183 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
2184 AC_MSG_CHECKING([how to link with lib[]$1])
2185 AC_MSG_RESULT([$LIB[]NAME])
2188 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2189 dnl $INC[]NAME either.
2190 CPPFLAGS="$ac_save_CPPFLAGS"
2195 AC_SUBST([HAVE_LIB]NAME)
2197 AC_SUBST([LTLIB]NAME)
2198 AC_SUBST([LIB]NAME[_PREFIX])
2203 dnl Determine the platform dependent parameters needed to use rpath:
2206 dnl acl_libname_spec,
2207 dnl acl_library_names_spec,
2208 dnl acl_hardcode_libdir_flag_spec,
2209 dnl acl_hardcode_libdir_separator,
2210 dnl acl_hardcode_direct,
2211 dnl acl_hardcode_minus_L.
2212 AC_DEFUN([AC_LIB_RPATH],
2214 dnl Complain if config.rpath is missing.
2215 AC_REQUIRE_AUX_FILE([config.rpath])
2216 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
2217 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
2218 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
2219 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
2220 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
2221 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
2222 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
2228 acl_libext="$acl_cv_libext"
2229 acl_shlibext="$acl_cv_shlibext"
2230 acl_libname_spec="$acl_cv_libname_spec"
2231 acl_library_names_spec="$acl_cv_library_names_spec"
2232 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
2233 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
2234 acl_hardcode_direct="$acl_cv_hardcode_direct"
2235 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
2236 dnl Determine whether the user wants rpath handling at all.
2237 AC_ARG_ENABLE([rpath],
2238 [ --disable-rpath do not hardcode runtime library paths],
2239 :, enable_rpath=yes)
2242 dnl AC_LIB_FROMPACKAGE(name, package)
2243 dnl declares that libname comes from the given package. The configure file
2244 dnl will then not have a --with-libname-prefix option but a
2245 dnl --with-package-prefix option. Several libraries can come from the same
2246 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
2247 dnl macro call that searches for libname.
2248 AC_DEFUN([AC_LIB_FROMPACKAGE],
2250 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2251 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2252 define([acl_frompackage_]NAME, [$2])
2254 pushdef([PACK],[$2])
2255 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
2256 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2257 define([acl_libsinpackage_]PACKUP,
2258 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
2263 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2264 dnl the libraries corresponding to explicit and implicit dependencies.
2265 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2266 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
2267 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2268 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2270 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2271 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2272 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2273 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
2274 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
2275 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2276 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
2277 dnl By default, look in $includedir and $libdir.
2279 AC_LIB_WITH_FINAL_PREFIX([
2280 eval additional_includedir=\"$includedir\"
2281 eval additional_libdir=\"$libdir\"
2282 eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
2283 eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
2285 AC_ARG_WITH(PACK[-prefix],
2286 [[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
2287 --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
2289 if test "X$withval" = "Xno"; then
2292 if test "X$withval" = "X"; then
2293 AC_LIB_WITH_FINAL_PREFIX([
2294 eval additional_includedir=\"$includedir\"
2295 eval additional_libdir=\"$libdir\"
2296 eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
2297 eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
2300 additional_includedir="$withval/include"
2301 additional_libdir="$withval/$acl_libdirstem"
2302 additional_libdir2="$withval/$acl_libdirstem2"
2303 additional_libdir3="$withval/$acl_libdirstem3"
2307 if test "X$additional_libdir2" = "X$additional_libdir"; then
2310 if test "X$additional_libdir3" = "X$additional_libdir"; then
2313 dnl Search the library and its dependencies in $additional_libdir and
2314 dnl $LDFLAGS. Using breadth-first-seach.
2319 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
2320 dnl computed. So it has to be reset here.
2324 names_already_handled=
2325 names_next_round='$1 $2'
2326 while test -n "$names_next_round"; do
2327 names_this_round="$names_next_round"
2329 for name in $names_this_round; do
2331 for n in $names_already_handled; do
2332 if test "$n" = "$name"; then
2337 if test -z "$already_handled"; then
2338 names_already_handled="$names_already_handled $name"
2339 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2340 dnl or AC_LIB_HAVE_LINKFLAGS call.
2341 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
2342 eval value=\"\$HAVE_LIB$uppername\"
2343 if test -n "$value"; then
2344 if test "$value" = yes; then
2345 eval value=\"\$LIB$uppername\"
2346 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2347 eval value=\"\$LTLIB$uppername\"
2348 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2350 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2351 dnl that this library doesn't exist. So just drop it.
2355 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2356 dnl and the already constructed $LIBNAME/$LTLIBNAME.
2361 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
2362 if test -n "$acl_shlibext"; then
2363 shrext=".$acl_shlibext" # typically: shrext=.so
2367 if test $use_additional = yes; then
2368 for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
2369 if test "X$found_dir" = "X"; then
2370 eval dir=\$$additional_libdir_variable
2371 if test -n "$dir"; then
2372 dnl The same code as in the loop below:
2373 dnl First look for a shared library.
2374 if test -n "$acl_shlibext"; then
2375 if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
2377 found_so="$dir/$libname$shrext"
2379 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
2380 ver=`(cd "$dir" && \
2381 for f in "$libname$shrext".*; do echo "$f"; done \
2382 | sed -e "s,^$libname$shrext\\\\.,," \
2383 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
2384 | sed 1q ) 2>/dev/null`
2385 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
2387 found_so="$dir/$libname$shrext.$ver"
2390 eval library_names=\"$acl_library_names_spec\"
2391 for f in $library_names; do
2392 if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
2401 dnl Then look for a static library.
2402 if test "X$found_dir" = "X"; then
2403 if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
2405 found_a="$dir/$libname.$acl_libext"
2408 if test "X$found_dir" != "X"; then
2409 if test -f "$dir/$libname.la"; then
2410 found_la="$dir/$libname.la"
2417 if test "X$found_dir" = "X"; then
2418 for x in $LDFLAGS $LTLIB[]NAME; do
2419 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2422 dir=`echo "X$x" | sed -e 's/^X-L//'`
2423 dnl First look for a shared library.
2424 if test -n "$acl_shlibext"; then
2425 if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
2427 found_so="$dir/$libname$shrext"
2429 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
2430 ver=`(cd "$dir" && \
2431 for f in "$libname$shrext".*; do echo "$f"; done \
2432 | sed -e "s,^$libname$shrext\\\\.,," \
2433 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
2434 | sed 1q ) 2>/dev/null`
2435 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
2437 found_so="$dir/$libname$shrext.$ver"
2440 eval library_names=\"$acl_library_names_spec\"
2441 for f in $library_names; do
2442 if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
2451 dnl Then look for a static library.
2452 if test "X$found_dir" = "X"; then
2453 if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
2455 found_a="$dir/$libname.$acl_libext"
2458 if test "X$found_dir" != "X"; then
2459 if test -f "$dir/$libname.la"; then
2460 found_la="$dir/$libname.la"
2465 if test "X$found_dir" != "X"; then
2470 if test "X$found_dir" != "X"; then
2471 dnl Found the library.
2472 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2473 if test "X$found_so" != "X"; then
2474 dnl Linking with a shared library. We attempt to hardcode its
2475 dnl directory into the executable's runpath, unless it's the
2476 dnl standard /usr/lib.
2477 if test "$enable_rpath" = no \
2478 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
2479 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
2480 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
2481 dnl No hardcoding is needed.
2482 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2484 dnl Use an explicit option to hardcode DIR into the resulting
2486 dnl Potentially add DIR to ltrpathdirs.
2487 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2489 for x in $ltrpathdirs; do
2490 if test "X$x" = "X$found_dir"; then
2495 if test -z "$haveit"; then
2496 ltrpathdirs="$ltrpathdirs $found_dir"
2498 dnl The hardcoding into $LIBNAME is system dependent.
2499 if test "$acl_hardcode_direct" = yes; then
2500 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2501 dnl resulting binary.
2502 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2504 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2505 dnl Use an explicit option to hardcode DIR into the resulting
2507 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2508 dnl Potentially add DIR to rpathdirs.
2509 dnl The rpathdirs will be appended to $LIBNAME at the end.
2511 for x in $rpathdirs; do
2512 if test "X$x" = "X$found_dir"; then
2517 if test -z "$haveit"; then
2518 rpathdirs="$rpathdirs $found_dir"
2521 dnl Rely on "-L$found_dir".
2522 dnl But don't add it if it's already contained in the LDFLAGS
2523 dnl or the already constructed $LIBNAME
2525 for x in $LDFLAGS $LIB[]NAME; do
2526 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2527 if test "X$x" = "X-L$found_dir"; then
2532 if test -z "$haveit"; then
2533 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2535 if test "$acl_hardcode_minus_L" != no; then
2536 dnl FIXME: Not sure whether we should use
2537 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2539 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2541 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
2542 dnl here, because this doesn't fit in flags passed to the
2543 dnl compiler. So give up. No hardcoding. This affects only
2544 dnl very old systems.
2545 dnl FIXME: Not sure whether we should use
2546 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2548 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2554 if test "X$found_a" != "X"; then
2555 dnl Linking with a static library.
2556 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2558 dnl We shouldn't come here, but anyway it's good to have a
2560 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2563 dnl Assume the include files are nearby.
2564 additional_includedir=
2565 case "$found_dir" in
2566 */$acl_libdirstem | */$acl_libdirstem/)
2567 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
2568 if test "$name" = '$1'; then
2569 LIB[]NAME[]_PREFIX="$basedir"
2571 additional_includedir="$basedir/include"
2573 */$acl_libdirstem2 | */$acl_libdirstem2/)
2574 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
2575 if test "$name" = '$1'; then
2576 LIB[]NAME[]_PREFIX="$basedir"
2578 additional_includedir="$basedir/include"
2580 */$acl_libdirstem3 | */$acl_libdirstem3/)
2581 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
2582 if test "$name" = '$1'; then
2583 LIB[]NAME[]_PREFIX="$basedir"
2585 additional_includedir="$basedir/include"
2588 if test "X$additional_includedir" != "X"; then
2589 dnl Potentially add $additional_includedir to $INCNAME.
2590 dnl But don't add it
2591 dnl 1. if it's the standard /usr/include,
2592 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2593 dnl 3. if it's already present in $CPPFLAGS or the already
2594 dnl constructed $INCNAME,
2595 dnl 4. if it doesn't exist as a directory.
2596 if test "X$additional_includedir" != "X/usr/include"; then
2598 if test "X$additional_includedir" = "X/usr/local/include"; then
2599 if test -n "$GCC"; then
2601 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2605 if test -z "$haveit"; then
2606 for x in $CPPFLAGS $INC[]NAME; do
2607 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2608 if test "X$x" = "X-I$additional_includedir"; then
2613 if test -z "$haveit"; then
2614 if test -d "$additional_includedir"; then
2615 dnl Really add $additional_includedir to $INCNAME.
2616 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2622 dnl Look for dependencies.
2623 if test -n "$found_la"; then
2624 dnl Read the .la file. It defines the variables
2625 dnl dlname, library_names, old_library, dependency_libs, current,
2626 dnl age, revision, installed, dlopen, dlpreopen, libdir.
2627 save_libdir="$libdir"
2629 */* | *\\*) . "$found_la" ;;
2630 *) . "./$found_la" ;;
2632 libdir="$save_libdir"
2633 dnl We use only dependency_libs.
2634 for dep in $dependency_libs; do
2637 dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2638 dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
2639 dnl But don't add it
2640 dnl 1. if it's the standard /usr/lib,
2641 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2642 dnl 3. if it's already present in $LDFLAGS or the already
2643 dnl constructed $LIBNAME,
2644 dnl 4. if it doesn't exist as a directory.
2645 if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
2646 && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
2647 && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
2649 if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
2650 || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
2651 || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
2652 if test -n "$GCC"; then
2654 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2658 if test -z "$haveit"; then
2660 for x in $LDFLAGS $LIB[]NAME; do
2661 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2662 if test "X$x" = "X-L$dependency_libdir"; then
2667 if test -z "$haveit"; then
2668 if test -d "$dependency_libdir"; then
2669 dnl Really add $dependency_libdir to $LIBNAME.
2670 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
2674 for x in $LDFLAGS $LTLIB[]NAME; do
2675 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2676 if test "X$x" = "X-L$dependency_libdir"; then
2681 if test -z "$haveit"; then
2682 if test -d "$dependency_libdir"; then
2683 dnl Really add $dependency_libdir to $LTLIBNAME.
2684 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
2691 dir=`echo "X$dep" | sed -e 's/^X-R//'`
2692 if test "$enable_rpath" != no; then
2693 dnl Potentially add DIR to rpathdirs.
2694 dnl The rpathdirs will be appended to $LIBNAME at the end.
2696 for x in $rpathdirs; do
2697 if test "X$x" = "X$dir"; then
2702 if test -z "$haveit"; then
2703 rpathdirs="$rpathdirs $dir"
2705 dnl Potentially add DIR to ltrpathdirs.
2706 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2708 for x in $ltrpathdirs; do
2709 if test "X$x" = "X$dir"; then
2714 if test -z "$haveit"; then
2715 ltrpathdirs="$ltrpathdirs $dir"
2720 dnl Handle this in the next round.
2721 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2724 dnl Handle this in the next round. Throw away the .la's
2725 dnl directory; it is already contained in a preceding -L
2727 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2730 dnl Most likely an immediate library name.
2731 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2732 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2738 dnl Didn't find the library; assume it is in the system directories
2739 dnl known to the linker and runtime loader. (All the system
2740 dnl directories known to the linker should also be known to the
2741 dnl runtime loader, otherwise the system is severely misconfigured.)
2742 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2743 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2749 if test "X$rpathdirs" != "X"; then
2750 if test -n "$acl_hardcode_libdir_separator"; then
2751 dnl Weird platform: only the last -rpath option counts, the user must
2752 dnl pass all path elements in one option. We can arrange that for a
2753 dnl single library, but not when more than one $LIBNAMEs are used.
2755 for found_dir in $rpathdirs; do
2756 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
2758 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
2759 acl_save_libdir="$libdir"
2761 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2762 libdir="$acl_save_libdir"
2763 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2765 dnl The -rpath options are cumulative.
2766 for found_dir in $rpathdirs; do
2767 acl_save_libdir="$libdir"
2769 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2770 libdir="$acl_save_libdir"
2771 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2775 if test "X$ltrpathdirs" != "X"; then
2776 dnl When using libtool, the option that works for both libraries and
2777 dnl executables is -R. The -R options are cumulative.
2778 for found_dir in $ltrpathdirs; do
2779 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2788 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2789 dnl unless already present in VAR.
2790 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2791 dnl contains two or three consecutive elements that belong together.
2792 AC_DEFUN([AC_LIB_APPENDTOVAR],
2794 for element in [$2]; do
2797 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2798 if test "X$x" = "X$element"; then
2803 if test -z "$haveit"; then
2804 [$1]="${[$1]}${[$1]:+ }$element"
2809 dnl For those cases where a variable contains several -L and -l options
2810 dnl referring to unknown libraries and directories, this macro determines the
2811 dnl necessary additional linker options for the runtime path.
2812 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
2813 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
2814 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
2815 dnl otherwise linking without libtool is assumed.
2816 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
2818 AC_REQUIRE([AC_LIB_RPATH])
2819 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2821 if test "$enable_rpath" != no; then
2822 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2823 dnl Use an explicit option to hardcode directories into the resulting
2828 if test -n "$next"; then
2830 dnl No need to hardcode the standard /usr/lib.
2831 if test "X$dir" != "X/usr/$acl_libdirstem" \
2832 && test "X$dir" != "X/usr/$acl_libdirstem2" \
2833 && test "X$dir" != "X/usr/$acl_libdirstem3"; then
2834 rpathdirs="$rpathdirs $dir"
2840 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
2841 dnl No need to hardcode the standard /usr/lib.
2842 if test "X$dir" != "X/usr/$acl_libdirstem" \
2843 && test "X$dir" != "X/usr/$acl_libdirstem2" \
2844 && test "X$dir" != "X/usr/$acl_libdirstem3"; then
2845 rpathdirs="$rpathdirs $dir"
2852 if test "X$rpathdirs" != "X"; then
2853 if test -n ""$3""; then
2854 dnl libtool is used for linking. Use -R options.
2855 for dir in $rpathdirs; do
2856 $1="${$1}${$1:+ }-R$dir"
2859 dnl The linker is used for linking directly.
2860 if test -n "$acl_hardcode_libdir_separator"; then
2861 dnl Weird platform: only the last -rpath option counts, the user
2862 dnl must pass all path elements in one option.
2864 for dir in $rpathdirs; do
2865 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
2867 acl_save_libdir="$libdir"
2869 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2870 libdir="$acl_save_libdir"
2873 dnl The -rpath options are cumulative.
2874 for dir in $rpathdirs; do
2875 acl_save_libdir="$libdir"
2877 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2878 libdir="$acl_save_libdir"
2879 $1="${$1}${$1:+ }$flag"
2889 # lib-prefix.m4 serial 17
2890 dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc.
2891 dnl This file is free software; the Free Software Foundation
2892 dnl gives unlimited permission to copy and/or distribute it,
2893 dnl with or without modifications, as long as this notice is preserved.
2895 dnl From Bruno Haible.
2897 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2898 dnl to access previously installed libraries. The basic assumption is that
2899 dnl a user will want packages to use other packages he previously installed
2900 dnl with the same --prefix option.
2901 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2902 dnl libraries, but is otherwise very convenient.
2903 AC_DEFUN([AC_LIB_PREFIX],
2905 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2906 AC_REQUIRE([AC_PROG_CC])
2907 AC_REQUIRE([AC_CANONICAL_HOST])
2908 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2909 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2910 dnl By default, look in $includedir and $libdir.
2912 AC_LIB_WITH_FINAL_PREFIX([
2913 eval additional_includedir=\"$includedir\"
2914 eval additional_libdir=\"$libdir\"
2916 AC_ARG_WITH([lib-prefix],
2917 [[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2918 --without-lib-prefix don't search for libraries in includedir and libdir]],
2920 if test "X$withval" = "Xno"; then
2923 if test "X$withval" = "X"; then
2924 AC_LIB_WITH_FINAL_PREFIX([
2925 eval additional_includedir=\"$includedir\"
2926 eval additional_libdir=\"$libdir\"
2929 additional_includedir="$withval/include"
2930 additional_libdir="$withval/$acl_libdirstem"
2934 if test $use_additional = yes; then
2935 dnl Potentially add $additional_includedir to $CPPFLAGS.
2936 dnl But don't add it
2937 dnl 1. if it's the standard /usr/include,
2938 dnl 2. if it's already present in $CPPFLAGS,
2939 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
2940 dnl 4. if it doesn't exist as a directory.
2941 if test "X$additional_includedir" != "X/usr/include"; then
2943 for x in $CPPFLAGS; do
2944 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2945 if test "X$x" = "X-I$additional_includedir"; then
2950 if test -z "$haveit"; then
2951 if test "X$additional_includedir" = "X/usr/local/include"; then
2952 if test -n "$GCC"; then
2954 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2958 if test -z "$haveit"; then
2959 if test -d "$additional_includedir"; then
2960 dnl Really add $additional_includedir to $CPPFLAGS.
2961 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2966 dnl Potentially add $additional_libdir to $LDFLAGS.
2967 dnl But don't add it
2968 dnl 1. if it's the standard /usr/lib,
2969 dnl 2. if it's already present in $LDFLAGS,
2970 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
2971 dnl 4. if it doesn't exist as a directory.
2972 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2974 for x in $LDFLAGS; do
2975 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2976 if test "X$x" = "X-L$additional_libdir"; then
2981 if test -z "$haveit"; then
2982 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2983 if test -n "$GCC"; then
2985 linux*) haveit=yes;;
2989 if test -z "$haveit"; then
2990 if test -d "$additional_libdir"; then
2991 dnl Really add $additional_libdir to $LDFLAGS.
2992 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
3000 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
3001 dnl acl_final_exec_prefix, containing the values to which $prefix and
3002 dnl $exec_prefix will expand at the end of the configure script.
3003 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
3005 dnl Unfortunately, prefix and exec_prefix get only finally determined
3006 dnl at the end of configure.
3007 if test "X$prefix" = "XNONE"; then
3008 acl_final_prefix="$ac_default_prefix"
3010 acl_final_prefix="$prefix"
3012 if test "X$exec_prefix" = "XNONE"; then
3013 acl_final_exec_prefix='${prefix}'
3015 acl_final_exec_prefix="$exec_prefix"
3017 acl_save_prefix="$prefix"
3018 prefix="$acl_final_prefix"
3019 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
3020 prefix="$acl_save_prefix"
3023 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
3024 dnl variables prefix and exec_prefix bound to the values they will have
3025 dnl at the end of the configure script.
3026 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
3028 acl_save_prefix="$prefix"
3029 prefix="$acl_final_prefix"
3030 acl_save_exec_prefix="$exec_prefix"
3031 exec_prefix="$acl_final_exec_prefix"
3033 exec_prefix="$acl_save_exec_prefix"
3034 prefix="$acl_save_prefix"
3037 dnl AC_LIB_PREPARE_MULTILIB creates
3038 dnl - a function acl_is_expected_elfclass, that tests whether standard input
3039 dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
3040 dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
3041 dnl the basename of the libdir to try in turn, either "lib" or "lib64" or
3042 dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
3043 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
3045 dnl There is no formal standard regarding lib, lib32, and lib64.
3046 dnl On most glibc systems, the current practice is that on a system supporting
3047 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
3048 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
3049 dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
3050 dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
3051 dnl We determine the compiler's default mode by looking at the compiler's
3052 dnl library search path. If at least one of its elements ends in /lib64 or
3053 dnl points to a directory whose absolute pathname ends in /lib64, we use that
3054 dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
3056 dnl On Solaris systems, the current practice is that on a system supporting
3057 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
3058 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
3059 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
3060 AC_REQUIRE([AC_CANONICAL_HOST])
3061 AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
3063 AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
3064 [AC_EGREP_CPP([Extensible Linking Format],
3066 Extensible Linking Format
3072 if test $gl_cv_elf; then
3073 # Extract the ELF class of a file (5th byte) in decimal.
3074 # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
3075 if od -A x < /dev/null >/dev/null 2>/dev/null; then
3079 od -A n -t d1 -j 4 -N 1
3085 dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
3090 case $HOST_CPU_C_ABI_32BIT in
3093 acl_is_expected_elfclass ()
3095 test "`func_elfclass | sed -e 's/[ ]//g'`" = 1
3100 acl_is_expected_elfclass ()
3102 test "`func_elfclass | sed -e 's/[ ]//g'`" = 2
3107 acl_is_expected_elfclass ()
3115 acl_is_expected_elfclass ()
3121 dnl Allow the user to override the result by setting acl_cv_libdirstems.
3122 AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
3123 [acl_cv_libdirstems],
3124 [dnl Try 'lib' first, because that's the default for libdir in GNU, see
3125 dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
3131 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
3132 dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
3133 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
3134 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
3135 dnl symlink is missing, so we set acl_libdirstem2 too.
3136 if test $HOST_CPU_C_ABI_32BIT = no; then
3137 acl_libdirstem2=lib/64
3139 sparc*) acl_libdirstem3=lib/sparcv9 ;;
3140 i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
3145 dnl If $CC generates code for a 32-bit ABI, the libraries are
3146 dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
3147 dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
3148 dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
3149 dnl Find the compiler's search path. However, non-system compilers
3150 dnl sometimes have odd library search paths. But we can't simply invoke
3151 dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
3152 dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
3153 searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
3154 | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
3155 if test $HOST_CPU_C_ABI_32BIT != no; then
3156 # 32-bit or unknown ABI.
3157 if test -d /usr/lib32; then
3158 acl_libdirstem2=lib32
3161 if test $HOST_CPU_C_ABI_32BIT != yes; then
3162 # 64-bit or unknown ABI.
3163 if test -d /usr/lib64; then
3164 acl_libdirstem3=lib64
3167 if test -n "$searchpath"; then
3168 acl_save_IFS="${IFS= }"; IFS=":"
3169 for searchdir in $searchpath; do
3170 if test -d "$searchdir"; then
3171 case "$searchdir" in
3172 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
3173 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
3175 # Better ignore directories of this form. They are misleading.
3177 *) searchdir=`cd "$searchdir" && pwd`
3178 case "$searchdir" in
3179 */lib32 ) acl_libdirstem2=lib32 ;;
3180 */lib64 ) acl_libdirstem3=lib64 ;;
3186 if test $HOST_CPU_C_ABI_32BIT = yes; then
3190 if test $HOST_CPU_C_ABI_32BIT = no; then
3197 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
3198 test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
3199 acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
3201 dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
3202 dnl acl_libdirstem3.
3204 acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
3205 acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
3206 acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
3210 # nls.m4 serial 6 (gettext-0.20.2)
3211 dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free
3212 dnl Software Foundation, Inc.
3213 dnl This file is free software; the Free Software Foundation
3214 dnl gives unlimited permission to copy and/or distribute it,
3215 dnl with or without modifications, as long as this notice is preserved.
3217 dnl This file can be used in projects which are not available under
3218 dnl the GNU General Public License or the GNU Lesser General Public
3219 dnl License but which still want to provide support for the GNU gettext
3221 dnl Please note that the actual code of the GNU gettext library is covered
3222 dnl by the GNU Lesser General Public License, and the rest of the GNU
3223 dnl gettext package is covered by the GNU General Public License.
3224 dnl They are *not* in the public domain.
3227 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3228 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3234 AC_MSG_CHECKING([whether NLS is requested])
3235 dnl Default is enabled NLS
3236 AC_ARG_ENABLE([nls],
3237 [ --disable-nls do not use Native Language Support],
3238 USE_NLS=$enableval, USE_NLS=yes)
3239 AC_MSG_RESULT([$USE_NLS])
3243 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
3244 # serial 12 (pkg-config-0.29.2)
3246 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
3247 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
3249 dnl This program is free software; you can redistribute it and/or modify
3250 dnl it under the terms of the GNU General Public License as published by
3251 dnl the Free Software Foundation; either version 2 of the License, or
3252 dnl (at your option) any later version.
3254 dnl This program is distributed in the hope that it will be useful, but
3255 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
3256 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3257 dnl General Public License for more details.
3259 dnl You should have received a copy of the GNU General Public License
3260 dnl along with this program; if not, write to the Free Software
3261 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3262 dnl 02111-1307, USA.
3264 dnl As a special exception to the GNU General Public License, if you
3265 dnl distribute this file as part of a program that contains a
3266 dnl configuration script generated by Autoconf, you may include it under
3267 dnl the same distribution terms that you use for the rest of that
3270 dnl PKG_PREREQ(MIN-VERSION)
3271 dnl -----------------------
3274 dnl Verify that the version of the pkg-config macros are at least
3275 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
3276 dnl installed version of pkg-config, this checks the developer's version
3277 dnl of pkg.m4 when generating configure.
3279 dnl To ensure that this macro is defined, also add:
3280 dnl m4_ifndef([PKG_PREREQ],
3281 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
3283 dnl See the "Since" comment for each macro you use to see what version
3284 dnl of the macros you require.
3285 m4_defun([PKG_PREREQ],
3286 [m4_define([PKG_MACROS_VERSION], [0.29.2])
3287 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
3288 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
3291 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
3292 dnl ----------------------------------
3295 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
3296 dnl first found in the path. Checks that the version of pkg-config found
3297 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
3298 dnl used since that's the first version where most current features of
3299 dnl pkg-config existed.
3300 AC_DEFUN([PKG_PROG_PKG_CONFIG],
3301 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
3302 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
3303 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
3304 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
3305 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
3306 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
3308 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
3309 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
3311 if test -n "$PKG_CONFIG"; then
3312 _pkg_min_version=m4_default([$1], [0.9.0])
3313 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
3314 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
3315 AC_MSG_RESULT([yes])
3321 ])dnl PKG_PROG_PKG_CONFIG
3323 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3324 dnl -------------------------------------------------------------------
3327 dnl Check to see whether a particular set of modules exists. Similar to
3328 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
3330 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3331 dnl only at the first occurence in configure.ac, so if the first place
3332 dnl it's called might be skipped (such as if it is within an "if", you
3333 dnl have to call PKG_CHECK_EXISTS manually
3334 AC_DEFUN([PKG_CHECK_EXISTS],
3335 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3336 if test -n "$PKG_CONFIG" && \
3337 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
3338 m4_default([$2], [:])
3339 m4_ifvaln([$3], [else
3343 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
3344 dnl ---------------------------------------------
3345 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
3346 dnl pkg_failed based on the result.
3347 m4_define([_PKG_CONFIG],
3348 [if test -n "$$1"; then
3350 elif test -n "$PKG_CONFIG"; then
3351 PKG_CHECK_EXISTS([$3],
3352 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
3353 test "x$?" != "x0" && pkg_failed=yes ],
3360 dnl _PKG_SHORT_ERRORS_SUPPORTED
3361 dnl ---------------------------
3362 dnl Internal check to see if pkg-config supports short errors.
3363 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
3364 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3365 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
3366 _pkg_short_errors_supported=yes
3368 _pkg_short_errors_supported=no
3370 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
3373 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
3374 dnl [ACTION-IF-NOT-FOUND])
3375 dnl --------------------------------------------------------------
3378 dnl Note that if there is a possibility the first call to
3379 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
3380 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
3381 AC_DEFUN([PKG_CHECK_MODULES],
3382 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3383 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
3384 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
3387 AC_MSG_CHECKING([for $2])
3389 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
3390 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
3392 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
3393 and $1[]_LIBS to avoid the need to call pkg-config.
3394 See the pkg-config man page for more details.])
3396 if test $pkg_failed = yes; then
3398 _PKG_SHORT_ERRORS_SUPPORTED
3399 if test $_pkg_short_errors_supported = yes; then
3400 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
3402 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
3404 # Put the nasty error message in config.log where it belongs
3405 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
3407 m4_default([$4], [AC_MSG_ERROR(
3408 [Package requirements ($2) were not met:
3412 Consider adjusting the PKG_CONFIG_PATH environment variable if you
3413 installed software in a non-standard prefix.
3417 elif test $pkg_failed = untried; then
3419 m4_default([$4], [AC_MSG_FAILURE(
3420 [The pkg-config script could not be found or is too old. Make sure it
3421 is in your PATH or set the PKG_CONFIG environment variable to the full
3426 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
3429 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
3430 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
3431 AC_MSG_RESULT([yes])
3434 ])dnl PKG_CHECK_MODULES
3437 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
3438 dnl [ACTION-IF-NOT-FOUND])
3439 dnl ---------------------------------------------------------------------
3442 dnl Checks for existence of MODULES and gathers its build flags with
3443 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
3444 dnl and VARIABLE-PREFIX_LIBS from --libs.
3446 dnl Note that if there is a possibility the first call to
3447 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
3448 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
3450 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
3451 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3452 _save_PKG_CONFIG=$PKG_CONFIG
3453 PKG_CONFIG="$PKG_CONFIG --static"
3454 PKG_CHECK_MODULES($@)
3455 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
3456 ])dnl PKG_CHECK_MODULES_STATIC
3459 dnl PKG_INSTALLDIR([DIRECTORY])
3460 dnl -------------------------
3463 dnl Substitutes the variable pkgconfigdir as the location where a module
3464 dnl should install pkg-config .pc files. By default the directory is
3465 dnl $libdir/pkgconfig, but the default can be changed by passing
3466 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
3468 AC_DEFUN([PKG_INSTALLDIR],
3469 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
3470 m4_pushdef([pkg_description],
3471 [pkg-config installation directory @<:@]pkg_default[@:>@])
3472 AC_ARG_WITH([pkgconfigdir],
3473 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
3474 [with_pkgconfigdir=]pkg_default)
3475 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
3476 m4_popdef([pkg_default])
3477 m4_popdef([pkg_description])
3478 ])dnl PKG_INSTALLDIR
3481 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
3482 dnl --------------------------------
3485 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
3486 dnl module should install arch-independent pkg-config .pc files. By
3487 dnl default the directory is $datadir/pkgconfig, but the default can be
3488 dnl changed by passing DIRECTORY. The user can override through the
3489 dnl --with-noarch-pkgconfigdir parameter.
3490 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
3491 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
3492 m4_pushdef([pkg_description],
3493 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
3494 AC_ARG_WITH([noarch-pkgconfigdir],
3495 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
3496 [with_noarch_pkgconfigdir=]pkg_default)
3497 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
3498 m4_popdef([pkg_default])
3499 m4_popdef([pkg_description])
3500 ])dnl PKG_NOARCH_INSTALLDIR
3503 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
3504 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3505 dnl -------------------------------------------
3508 dnl Retrieves the value of the pkg-config variable for the given module.
3509 AC_DEFUN([PKG_CHECK_VAR],
3510 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3511 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
3513 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
3514 AS_VAR_COPY([$1], [pkg_cv_][$1])
3516 AS_VAR_IF([$1], [""], [$5], [$4])dnl
3519 # po.m4 serial 31 (gettext-0.20.2)
3520 dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
3521 dnl This file is free software; the Free Software Foundation
3522 dnl gives unlimited permission to copy and/or distribute it,
3523 dnl with or without modifications, as long as this notice is preserved.
3525 dnl This file can be used in projects which are not available under
3526 dnl the GNU General Public License or the GNU Lesser General Public
3527 dnl License but which still want to provide support for the GNU gettext
3529 dnl Please note that the actual code of the GNU gettext library is covered
3530 dnl by the GNU Lesser General Public License, and the rest of the GNU
3531 dnl gettext package is covered by the GNU General Public License.
3532 dnl They are *not* in the public domain.
3535 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3536 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3540 dnl Checks for all prerequisites of the po subdirectory.
3541 AC_DEFUN([AM_PO_SUBDIRS],
3543 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3544 AC_REQUIRE([AC_PROG_INSTALL])dnl
3545 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3546 AC_REQUIRE([AC_PROG_SED])dnl
3547 AC_REQUIRE([AM_NLS])dnl
3549 dnl Release version of the gettext macros. This is used to ensure that
3550 dnl the gettext macros and po/Makefile.in.in are in sync.
3551 AC_SUBST([GETTEXT_MACRO_VERSION], [0.20])
3553 dnl Perform the following tests also if --disable-nls has been given,
3554 dnl because they are needed for "make dist" to work.
3556 dnl Search for GNU msgfmt in the PATH.
3557 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3558 dnl The second test excludes FreeBSD msgfmt.
3559 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3560 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3561 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3563 AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
3565 dnl Test whether it is GNU msgfmt >= 0.15.
3567 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3568 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
3569 *) GMSGFMT_015=$GMSGFMT ;;
3572 AC_SUBST([GMSGFMT_015])
3574 dnl Search for GNU xgettext 0.12 or newer in the PATH.
3575 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3576 dnl The second test excludes FreeBSD xgettext.
3577 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3578 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3579 (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3581 dnl Remove leftover from FreeBSD xgettext call.
3584 dnl Test whether it is GNU xgettext >= 0.15.
3586 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3587 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
3588 *) XGETTEXT_015=$XGETTEXT ;;
3591 AC_SUBST([XGETTEXT_015])
3593 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3594 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3595 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
3597 dnl Test whether it is GNU msgmerge >= 0.20.
3598 if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
3599 MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
3601 dnl Test whether it is GNU msgmerge >= 0.12.
3602 if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
3603 MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
3605 dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is
3606 dnl slow. But this is not a big problem, as such old gettext versions are
3607 dnl hardly in use any more.
3608 MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
3611 AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
3613 dnl Support for AM_XGETTEXT_OPTION.
3614 test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
3615 AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
3617 AC_CONFIG_COMMANDS([po-directories], [[
3618 for ac_file in $CONFIG_FILES; do
3619 # Support "outfile[:infile[:infile...]]"
3621 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3623 # PO directories have a Makefile.in generated from Makefile.in.in.
3624 case "$ac_file" in */Makefile.in)
3625 # Adjust a relative srcdir.
3626 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3627 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3628 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3629 # In autoconf-2.13 it is called $ac_given_srcdir.
3630 # In autoconf-2.50 it is called $srcdir.
3631 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3632 case "$ac_given_srcdir" in
3633 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3634 /*) top_srcdir="$ac_given_srcdir" ;;
3635 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3637 # Treat a directory as a PO directory if and only if it has a
3638 # POTFILES.in file. This allows packages to have multiple PO
3639 # directories under different names or in different locations.
3640 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3641 rm -f "$ac_dir/POTFILES"
3642 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3643 gt_tab=`printf '\t'`
3644 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
3645 POMAKEFILEDEPS="POTFILES.in"
3646 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
3647 # on $ac_dir but don't depend on user-specified configuration
3649 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3650 # The LINGUAS file contains the set of available languages.
3651 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3652 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3654 ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3655 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3657 # The set of available languages was given in configure.in.
3658 ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
3661 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3662 # Compute UPDATEPOFILES
3663 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3664 # Compute DUMMYPOFILES
3665 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3667 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3668 case "$ac_given_srcdir" in
3670 *) srcdirpre='$(srcdir)/' ;;
3676 for lang in $ALL_LINGUAS; do
3677 POFILES="$POFILES $srcdirpre$lang.po"
3678 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3679 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3680 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3682 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3683 # environment variable.
3685 if test -n "$ALL_LINGUAS"; then
3686 for presentlang in $ALL_LINGUAS; do
3688 if test "%UNSET%" != "$LINGUAS"; then
3689 desiredlanguages="$LINGUAS"
3691 desiredlanguages="$ALL_LINGUAS"
3693 for desiredlang in $desiredlanguages; do
3694 # Use the presentlang catalog if desiredlang is
3695 # a. equal to presentlang, or
3696 # b. a variant of presentlang (because in this case,
3697 # presentlang can be used as a fallback for messages
3698 # which are not translated in the desiredlang catalog).
3699 case "$desiredlang" in
3700 "$presentlang"*) useit=yes;;
3703 if test $useit = yes; then
3704 INST_LINGUAS="$INST_LINGUAS $presentlang"
3709 if test -n "$INST_LINGUAS"; then
3710 for lang in $INST_LINGUAS; do
3711 CATALOGS="$CATALOGS $lang.gmo"
3714 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3715 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
3716 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3717 if test -f "$f"; then
3719 *.orig | *.bak | *~) ;;
3720 *) cat "$f" >> "$ac_dir/Makefile" ;;
3728 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3729 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
3730 OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
3731 # Capture the value of LINGUAS because we need it to compute CATALOGS.
3732 LINGUAS="${LINGUAS-%UNSET%}"
3736 dnl Postprocesses a Makefile in a directory containing PO files.
3737 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
3739 # When this code is run, in config.status, two variables have already been
3741 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
3742 # - LINGUAS is the value of the environment variable LINGUAS at configure
3746 # Adjust a relative srcdir.
3747 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3748 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3749 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3750 # In autoconf-2.13 it is called $ac_given_srcdir.
3751 # In autoconf-2.50 it is called $srcdir.
3752 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3753 case "$ac_given_srcdir" in
3754 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3755 /*) top_srcdir="$ac_given_srcdir" ;;
3756 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3759 # Find a way to echo strings without interpreting backslash.
3760 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
3763 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
3764 gt_echo='printf %s\n'
3775 # A sed script that extracts the value of VARIABLE from a Makefile.
3778 # Test if the hold space is empty.
3783 # Yes it was empty. Look if we have the expected variable definition.
3784 /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
3785 # Seen the first line of the variable definition.
3786 s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
3791 # Here we are processing a line from the variable definition.
3792 # Remove comment, more precisely replace it with a space.
3794 # See if the line ends in a backslash.
3798 # Print the line, without the trailing backslash.
3801 # There was no trailing backslash. The end of the variable definition is
3802 # reached. Clear the hold space.
3807 # A trailing backslash means that the variable definition continues in the
3808 # next line. Put a nonempty string into the hold space to indicate this.
3815 # Set POTFILES to the value of the Makefile variable POTFILES.
3816 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
3817 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
3818 # Compute POTFILES_DEPS as
3819 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
3821 for file in $POTFILES; do
3822 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
3826 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3827 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3829 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3830 # The LINGUAS file contains the set of available languages.
3831 ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3832 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3834 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
3835 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
3836 ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
3839 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3840 # Compute UPDATEPOFILES
3841 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3842 # Compute DUMMYPOFILES
3843 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3845 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3846 # Compute PROPERTIESFILES
3847 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties)
3848 # Compute CLASSFILES
3849 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class)
3851 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3853 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
3854 # Compute RESOURCESDLLFILES
3855 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
3856 case "$ac_given_srcdir" in
3858 *) srcdirpre='$(srcdir)/' ;;
3869 for lang in $ALL_LINGUAS; do
3870 POFILES="$POFILES $srcdirpre$lang.po"
3871 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3872 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3873 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3874 PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties"
3875 CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class"
3876 QMFILES="$QMFILES $srcdirpre$lang.qm"
3877 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3878 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
3879 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3880 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
3882 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3883 # environment variable.
3885 if test -n "$ALL_LINGUAS"; then
3886 for presentlang in $ALL_LINGUAS; do
3888 if test "%UNSET%" != "$LINGUAS"; then
3889 desiredlanguages="$LINGUAS"
3891 desiredlanguages="$ALL_LINGUAS"
3893 for desiredlang in $desiredlanguages; do
3894 # Use the presentlang catalog if desiredlang is
3895 # a. equal to presentlang, or
3896 # b. a variant of presentlang (because in this case,
3897 # presentlang can be used as a fallback for messages
3898 # which are not translated in the desiredlang catalog).
3899 case "$desiredlang" in
3900 "$presentlang"*) useit=yes;;
3903 if test $useit = yes; then
3904 INST_LINGUAS="$INST_LINGUAS $presentlang"
3913 if test -n "$INST_LINGUAS"; then
3914 for lang in $INST_LINGUAS; do
3915 CATALOGS="$CATALOGS $lang.gmo"
3916 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
3917 QTCATALOGS="$QTCATALOGS $lang.qm"
3918 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3919 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
3920 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3921 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
3925 sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
3927 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
3928 # Add dependencies that cannot be formulated as a simple suffix rule.
3929 for lang in $ALL_LINGUAS; do
3930 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3931 cat >> "$ac_file.tmp" <<EOF
3932 $frobbedlang.msg: $lang.po
3933 ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
3934 ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3938 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
3939 # Add dependencies that cannot be formulated as a simple suffix rule.
3940 for lang in $ALL_LINGUAS; do
3941 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3942 cat >> "$ac_file.tmp" <<EOF
3943 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
3944 ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
3945 ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3949 if test -n "$POMAKEFILEDEPS"; then
3950 cat >> "$ac_file.tmp" <<EOF
3951 Makefile: $POMAKEFILEDEPS
3954 mv "$ac_file.tmp" "$ac_file"
3957 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
3958 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
3960 XGETTEXT_EXTRA_OPTIONS=
3963 dnl Registers an option to be passed to xgettext in the po subdirectory.
3964 AC_DEFUN([AM_XGETTEXT_OPTION],
3966 AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
3967 XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
3970 # progtest.m4 serial 8 (gettext-0.20.2)
3971 dnl Copyright (C) 1996-2003, 2005, 2008-2020 Free Software Foundation, Inc.
3972 dnl This file is free software; the Free Software Foundation
3973 dnl gives unlimited permission to copy and/or distribute it,
3974 dnl with or without modifications, as long as this notice is preserved.
3976 dnl This file can be used in projects which are not available under
3977 dnl the GNU General Public License or the GNU Lesser General Public
3978 dnl License but which still want to provide support for the GNU gettext
3980 dnl Please note that the actual code of the GNU gettext library is covered
3981 dnl by the GNU Lesser General Public License, and the rest of the GNU
3982 dnl gettext package is covered by the GNU General Public License.
3983 dnl They are *not* in the public domain.
3986 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
3990 # Search path for a program which passes the given test.
3992 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3993 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3994 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3996 # Prepare PATH_SEPARATOR.
3997 # The user is always right.
3998 if test "${PATH_SEPARATOR+set}" != set; then
3999 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
4000 # contains only /bin. Note that ksh looks also at the FPATH variable,
4001 # so we have to set that as well for the test.
4003 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
4004 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
4005 || PATH_SEPARATOR=';'
4009 # Find out how to test for executable files. Don't use a zero-byte file,
4010 # as systems may use methods other than mode bits to determine executability.
4011 cat >conf$$.file <<_ASEOF
4015 chmod +x conf$$.file
4016 if test -x conf$$.file >/dev/null 2>&1; then
4017 ac_executable_p="test -x"
4019 ac_executable_p="test -f"
4023 # Extract the first word of "$2", so it can be a program name with args.
4024 set dummy $2; ac_word=[$]2
4025 AC_MSG_CHECKING([for $ac_word])
4026 AC_CACHE_VAL([ac_cv_path_$1],
4028 [[\\/]]* | ?:[[\\/]]*)
4029 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
4032 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
4033 for ac_dir in ifelse([$5], , $PATH, [$5]); do
4035 test -z "$ac_dir" && ac_dir=.
4036 for ac_exec_ext in '' $ac_executable_extensions; do
4037 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
4038 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
4040 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
4047 dnl If no 4th arg is given, leave the cache variable unset,
4048 dnl so AC_PATH_PROGS will keep looking.
4049 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
4054 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
4055 AC_MSG_RESULT([$][$1])
4062 m4_include([acinclude.m4])