• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
2
3# Copyright (C) 1996-2020 Free Software Foundation, Inc.
4
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.
8
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
12# PARTICULAR PURPOSE.
13
14m4_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# ===========================================================================
18#
19# SYNOPSIS
20#
21#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
22#
23# DESCRIPTION
24#
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.)
30#
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.)
34#
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
38#
39#   If you are only building threaded programs, you may wish to use these
40#   variables in your default LIBS, CFLAGS, and CC:
41#
42#     LIBS="$PTHREAD_LIBS $LIBS"
43#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
44#     CC="$PTHREAD_CC"
45#
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).
49#
50#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
51#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
52#   PTHREAD_CFLAGS.
53#
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.
58#
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.
65#
66#   Updated for Autoconf 2.68 by Daniel Richard G.
67#
68# LICENSE
69#
70#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
71#   Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
72#
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.
77#
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.
82#
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/>.
85#
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.
93#
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.
98
99#serial 24
100
101AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
102AC_DEFUN([AX_PTHREAD], [
103AC_REQUIRE([AC_CANONICAL_HOST])
104AC_REQUIRE([AC_PROG_CC])
105AC_REQUIRE([AC_PROG_SED])
106AC_LANG_PUSH([C])
107ax_pthread_ok=no
108
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.
112
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
115# them:
116if 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
127                PTHREAD_LIBS=""
128                PTHREAD_CFLAGS=""
129        fi
130        CC="$ax_pthread_save_CC"
131        CFLAGS="$ax_pthread_save_CFLAGS"
132        LIBS="$ax_pthread_save_LIBS"
133fi
134
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).
139
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.
144
145ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
146
147# The ordering *is* (sometimes) important.  Some notes on the
148# individual items follow:
149
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)
166
167case $host_os in
168
169        freebsd*)
170
171        # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
172        # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
173
174        ax_pthread_flags="-kthread lthread $ax_pthread_flags"
175        ;;
176
177        hpux*)
178
179        # From the cc(1) man page: "[-mt] Sets various -D flags to enable
180        # multi-threading and also sets -lpthread."
181
182        ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
183        ;;
184
185        openedition*)
186
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.)
191
192        AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
193            [
194#            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
195             AX_PTHREAD_ZOS_MISSING
196#            endif
197            ],
198            [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
199        ;;
200
201        solaris*)
202
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).
210
211        ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
212        ;;
213esac
214
215# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
216
217AS_IF([test "x$GCC" = "xyes"],
218      [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
219
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
222# correctly enabled
223
224case $host_os in
225        darwin* | hpux* | linux* | osf* | solaris*)
226        ax_pthread_check_macro="_REENTRANT"
227        ;;
228
229        aix*)
230        ax_pthread_check_macro="_THREAD_SAFE"
231        ;;
232
233        *)
234        ax_pthread_check_macro="--"
235        ;;
236esac
237AS_IF([test "x$ax_pthread_check_macro" = "x--"],
238      [ax_pthread_check_cond=0],
239      [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
240
241# Are we compiling with Clang?
242
243AC_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
252#            endif
253            ],
254            [ax_cv_PTHREAD_CLANG=yes])
255     fi
256    ])
257ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
258
259ax_pthread_clang_warning=no
260
261# Clang needs special handling, because older versions handle the -pthread
262# option in a rather... idiosyncratic way
263
264if test "x$ax_pthread_clang" = "xyes"; then
265
266        # Clang takes -pthread; it has never supported any other flag
267
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.)
271
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.)
277
278        PTHREAD_CFLAGS="-pthread"
279        PTHREAD_LIBS=
280
281        ax_pthread_ok=yes
282
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.
288        #
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.
296        #
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.
301
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
308             # step
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;}]])],
321                         [break])
322                    ])
323             done
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"
328            ])
329
330        case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
331                no | unknown) ;;
332                *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
333        esac
334
335fi # $ax_pthread_clang = yes
336
337if test "x$ax_pthread_ok" = "xno"; then
338for ax_pthread_try_flag in $ax_pthread_flags; do
339
340        case $ax_pthread_try_flag in
341                none)
342                AC_MSG_CHECKING([whether pthreads work without any flags])
343                ;;
344
345                -mt,pthread)
346                AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
347                PTHREAD_CFLAGS="-mt"
348                PTHREAD_LIBS="-lpthread"
349                ;;
350
351                -*)
352                AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
353                PTHREAD_CFLAGS="$ax_pthread_try_flag"
354                ;;
355
356                pthread-config)
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`"
361                ;;
362
363                *)
364                AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
365                PTHREAD_LIBS="-l$ax_pthread_try_flag"
366                ;;
367        esac
368
369        ax_pthread_save_CFLAGS="$CFLAGS"
370        ax_pthread_save_LIBS="$LIBS"
371        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
372        LIBS="$PTHREAD_LIBS $LIBS"
373
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.
383
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"
387#                       endif
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);
392                        pthread_join(th, 0);
393                        pthread_attr_init(&attr);
394                        pthread_cleanup_push(routine, 0);
395                        pthread_cleanup_pop(0) /* ; */])],
396            [ax_pthread_ok=yes],
397            [])
398
399        CFLAGS="$ax_pthread_save_CFLAGS"
400        LIBS="$ax_pthread_save_LIBS"
401
402        AC_MSG_RESULT([$ax_pthread_ok])
403        AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
404
405        PTHREAD_LIBS=""
406        PTHREAD_CFLAGS=""
407done
408fi
409
410# Various other checks:
411if 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"
416
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],
425                                [])
426             done
427            ])
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
436              ])
437
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
441             case $host_os in
442             solaris*)
443             ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
444             ;;
445             esac
446            ])
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])
451
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])
458            ])
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
463              ])
464
465        CFLAGS="$ax_pthread_save_CFLAGS"
466        LIBS="$ax_pthread_save_LIBS"
467
468        # More AIX lossage: compile with *_r variant
469        if test "x$GCC" != "xyes"; then
470            case $host_os in
471                aix*)
472                AS_CASE(["x/$CC"],
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
475                     AS_CASE(["x$CC"],
476                         [x/*],
477                         [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
478                         [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
479                ;;
480            esac
481        fi
482fi
483
484test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
485
486AC_SUBST([PTHREAD_LIBS])
487AC_SUBST([PTHREAD_CFLAGS])
488AC_SUBST([PTHREAD_CC])
489
490# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
491if 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])
493        :
494else
495        ax_pthread_ok=no
496        $2
497fi
498AC_LANG_POP
499])dnl AX_PTHREAD
500
501# gettext.m4 serial 71 (gettext-0.20.2)
502dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
503dnl This file is free software; the Free Software Foundation
504dnl gives unlimited permission to copy and/or distribute it,
505dnl with or without modifications, as long as this notice is preserved.
506dnl
507dnl This file can be used in projects which are not available under
508dnl the GNU General Public License or the GNU Lesser General Public
509dnl License but which still want to provide support for the GNU gettext
510dnl functionality.
511dnl Please note that the actual code of the GNU gettext library is covered
512dnl by the GNU Lesser General Public License, and the rest of the GNU
513dnl gettext package is covered by the GNU General Public License.
514dnl They are *not* in the public domain.
515
516dnl Authors:
517dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
518dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
519
520dnl Macro to add for using GNU gettext.
521
522dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
523dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
524dnl    INTLSYMBOL should be 'external' for packages other than GNU gettext, and
525dnl    'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
526dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
527dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
528dnl    depending on --{enable,disable}-{shared,static} and on the presence of
529dnl    AM-DISABLE-SHARED).
530dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
531dnl    implementations (in libc or libintl) without the ngettext() function
532dnl    will be ignored.  If NEEDSYMBOL is specified and is
533dnl    'need-formatstring-macros', then GNU gettext implementations that don't
534dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
535dnl INTLDIR is used to find the intl libraries.  If empty,
536dnl    the value '$(top_builddir)/intl/' is used.
537dnl
538dnl The result of the configuration is one of three cases:
539dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
540dnl    and used.
541dnl    Catalog format: GNU --> install in $(datadir)
542dnl    Catalog extension: .mo after installation, .gmo in source tree
543dnl 2) GNU gettext has been found in the system's C library.
544dnl    Catalog format: GNU --> install in $(datadir)
545dnl    Catalog extension: .mo after installation, .gmo in source tree
546dnl 3) No internationalization, always use English msgid.
547dnl    Catalog format: none
548dnl    Catalog extension: none
549dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
550dnl The use of .gmo is historical (it was needed to avoid overwriting the
551dnl GNU format catalogs when building on a platform with an X/Open gettext),
552dnl but we keep it in order not to force irrelevant filename changes on the
553dnl maintainers.
554dnl
555AC_DEFUN([AM_GNU_GETTEXT],
556[
557  dnl Argument checking.
558  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
559    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
560])])])])
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.
563])])
564  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
565    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
566])])])])
567  define([gt_included_intl],
568    ifelse([$1], [external], [no], [yes]))
569  gt_NEEDS_INIT
570  AM_GNU_GETTEXT_NEED([$2])
571
572  AC_REQUIRE([AM_PO_SUBDIRS])dnl
573  ifelse(gt_included_intl, yes, [
574    AC_REQUIRE([AM_INTL_SUBDIR])dnl
575  ])
576
577  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
578  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
579  AC_REQUIRE([AC_LIB_RPATH])
580
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])
593  ])
594
595  dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
596  gt_INTL_MACOSX
597
598  dnl Set USE_NLS.
599  AC_REQUIRE([AM_NLS])
600
601  ifelse(gt_included_intl, yes, [
602    BUILD_INCLUDED_LIBINTL=no
603    USE_INCLUDED_LIBINTL=no
604  ])
605  LIBINTL=
606  LTLIBINTL=
607  POSUB=
608
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 ;;
614  esac
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"
617
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])
628
629      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
630      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
631    ])
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.
635
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)
640#endif
641changequote(,)dnl
642typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
643changequote([,])dnl
644'
645        else
646          gt_revision_test_code=
647        fi
648        if test $gt_api_version -ge 2; then
649          gt_expression_test_code=' + * ngettext ("", "", 0)'
650        else
651          gt_expression_test_code=
652        fi
653
654        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
655         [AC_LINK_IFELSE(
656            [AC_LANG_PROGRAM(
657               [[
658#include <libintl.h>
659#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
660extern int _nl_msg_cat_cntr;
661extern int *_nl_domain_bindings;
662#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
663#else
664#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
665#endif
666$gt_revision_test_code
667               ]],
668               [[
669bindtextdomain ("", "");
670return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
671               ]])],
672            [eval "$gt_func_gnugettext_libc=yes"],
673            [eval "$gt_func_gnugettext_libc=no"])])
674
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, , [
678            AM_ICONV_LINK
679          ])
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"
689            gt_save_LIBS="$LIBS"
690            LIBS="$LIBS $LIBINTL"
691            dnl Now see whether libintl exists and does not depend on libiconv.
692            AC_LINK_IFELSE(
693              [AC_LANG_PROGRAM(
694                 [[
695#include <libintl.h>
696#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
697extern int _nl_msg_cat_cntr;
698extern
699#ifdef __cplusplus
700"C"
701#endif
702const char *_nl_expand_alias (const char *);
703#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
704#else
705#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
706#endif
707$gt_revision_test_code
708                 ]],
709                 [[
710bindtextdomain ("", "");
711return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
712                 ]])],
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"
718              AC_LINK_IFELSE(
719                [AC_LANG_PROGRAM(
720                   [[
721#include <libintl.h>
722#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
723extern int _nl_msg_cat_cntr;
724extern
725#ifdef __cplusplus
726"C"
727#endif
728const char *_nl_expand_alias (const char *);
729#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
730#else
731#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
732#endif
733$gt_revision_test_code
734                   ]],
735                   [[
736bindtextdomain ("", "");
737return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
738                   ]])],
739                [LIBINTL="$LIBINTL $LIBICONV"
740                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
741                 eval "$gt_func_gnugettext_libintl=yes"
742                ])
743            fi
744            CPPFLAGS="$gt_save_CPPFLAGS"
745            LIBS="$gt_save_LIBS"])
746        fi
747
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
757        else
758          dnl Reset the values set by searching for libintl.
759          LIBINTL=
760          LTLIBINTL=
761          INCINTL=
762        fi
763
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
769        fi
770      fi
771
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/ $//'`
779      fi
780
781      CATOBJEXT=
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.
785        CATOBJEXT=.gmo
786      fi
787    ])
788
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"
795      fi
796    fi
797
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
802   is requested.])
803    else
804      USE_NLS=no
805    fi
806  fi
807
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"
815      else
816        gt_source="libc"
817      fi
818    else
819      gt_source="included intl directory"
820    fi
821    AC_MSG_RESULT([$gt_source])
822  fi
823
824  if test "$USE_NLS" = "yes"; then
825
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])
831      fi
832
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.])
838    fi
839
840    dnl We need to process the po/ directory.
841    POSUB=po
842  fi
843
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
848
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])
853  ])
854
855  dnl For backward compatibility. Some Makefiles may be using this.
856  INTLLIBS="$LIBINTL"
857  AC_SUBST([INTLLIBS])
858
859  dnl Make all documented variables known to autoconf.
860  AC_SUBST([LIBINTL])
861  AC_SUBST([LTLIBINTL])
862  AC_SUBST([POSUB])
863])
864
865
866dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
867m4_define([gt_NEEDS_INIT],
868[
869  m4_divert_text([DEFAULTS], [gt_needs=])
870  m4_define([gt_NEEDS_INIT], [])
871])
872
873
874dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
875AC_DEFUN([AM_GNU_GETTEXT_NEED],
876[
877  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
878])
879
880
881dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
882AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
883
884
885dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
886AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
887
888# host-cpu-c-abi.m4 serial 13
889dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
890dnl This file is free software; the Free Software Foundation
891dnl gives unlimited permission to copy and/or distribute it,
892dnl with or without modifications, as long as this notice is preserved.
893
894dnl From Bruno Haible and Sam Steingold.
895
896dnl Sets the HOST_CPU variable to the canonical name of the CPU.
897dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
898dnl C language ABI (application binary interface).
899dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
900dnl config.h.
901dnl
902dnl This canonical name can be used to select a particular assembly language
903dnl source file that will interoperate with C code on the given host.
904dnl
905dnl For example:
906dnl * 'i386' and 'sparc' are different canonical names, because code for i386
907dnl   will not run on SPARC CPUs and vice versa. They have different
908dnl   instruction sets.
909dnl * 'sparc' and 'sparc64' are different canonical names, because code for
910dnl   'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
911dnl   contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
912dnl   instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
913dnl   mode, but not both.
914dnl * 'mips' and 'mipsn32' are different canonical names, because they use
915dnl   different argument passing and return conventions for C functions, and
916dnl   although the instruction set of 'mips' is a large subset of the
917dnl   instruction set of 'mipsn32'.
918dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
919dnl   different sizes for the C types like 'int' and 'void *', and although
920dnl   the instruction sets of 'mipsn32' and 'mips64' are the same.
921dnl * The same canonical name is used for different endiannesses. You can
922dnl   determine the endianness through preprocessor symbols:
923dnl   - 'arm': test __ARMEL__.
924dnl   - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
925dnl   - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
926dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
927dnl   (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
928dnl   - Instructions that do not exist on all of these CPUs (cmpxchg,
929dnl     MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
930dnl     assembly language source files use such instructions, you will
931dnl     need to make the distinction.
932dnl   - Speed of execution of the common instruction set is reasonable across
933dnl     the entire family of CPUs. If you have assembly language source files
934dnl     that are optimized for particular CPU types (like GNU gmp has), you
935dnl     will need to make the distinction.
936dnl   See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
937AC_DEFUN([gl_HOST_CPU_C_ABI],
938[
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],
942    [case "$host_cpu" in
943
944changequote(,)dnl
945       i[34567]86 )
946changequote([,])dnl
947         gl_cv_host_cpu_c_abi=i386
948         ;;
949
950       x86_64 )
951         # On x86_64 systems, the C compiler may be generating code in one of
952         # these ABIs:
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.
958         AC_COMPILE_IFELSE(
959           [AC_LANG_SOURCE(
960              [[#if (defined __x86_64__ || defined __amd64__ \
961                     || defined _M_X64 || defined _M_AMD64)
962                 int ok;
963                #else
964                 error fail
965                #endif
966              ]])],
967           [AC_COMPILE_IFELSE(
968              [AC_LANG_SOURCE(
969                 [[#if defined __ILP32__ || defined _ILP32
970                    int ok;
971                   #else
972                    error fail
973                   #endif
974                 ]])],
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])
978         ;;
979
980changequote(,)dnl
981       alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
982changequote([,])dnl
983         gl_cv_host_cpu_c_abi=alpha
984         ;;
985
986       arm* | aarch64 )
987         # Assume arm with EABI.
988         # On arm64 systems, the C compiler may be generating code in one of
989         # these ABIs:
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.
993         AC_COMPILE_IFELSE(
994           [AC_LANG_SOURCE(
995              [[#ifdef __aarch64__
996                 int ok;
997                #else
998                 error fail
999                #endif
1000              ]])],
1001           [AC_COMPILE_IFELSE(
1002              [AC_LANG_SOURCE(
1003                [[#if defined __ILP32__ || defined _ILP32
1004                   int ok;
1005                  #else
1006                   error fail
1007                  #endif
1008                ]])],
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
1027            else
1028              gl_cv_host_cpu_c_abi=arm
1029            fi
1030            rm -f conftest*
1031           ])
1032         ;;
1033
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__.
1037         AC_COMPILE_IFELSE(
1038           [AC_LANG_SOURCE(
1039              [[#ifdef __LP64__
1040                 int ok;
1041                #else
1042                 error fail
1043                #endif
1044              ]])],
1045           [gl_cv_host_cpu_c_abi=hppa64],
1046           [gl_cv_host_cpu_c_abi=hppa])
1047         ;;
1048
1049       ia64* )
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.
1052         AC_COMPILE_IFELSE(
1053           [AC_LANG_SOURCE(
1054              [[#ifdef _ILP32
1055                 int ok;
1056                #else
1057                 error fail
1058                #endif
1059              ]])],
1060           [gl_cv_host_cpu_c_abi=ia64-ilp32],
1061           [gl_cv_host_cpu_c_abi=ia64])
1062         ;;
1063
1064       mips* )
1065         # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
1066         # at 32.
1067         AC_COMPILE_IFELSE(
1068           [AC_LANG_SOURCE(
1069              [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
1070                 int ok;
1071                #else
1072                 error fail
1073                #endif
1074              ]])],
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.
1080            AC_COMPILE_IFELSE(
1081              [AC_LANG_SOURCE(
1082                 [[#if (_MIPS_SIM == _ABIN32)
1083                    int ok;
1084                   #else
1085                    error fail
1086                   #endif
1087                 ]])],
1088              [gl_cv_host_cpu_c_abi=mipsn32],
1089              [gl_cv_host_cpu_c_abi=mips])])
1090         ;;
1091
1092       powerpc* )
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.
1099         AC_COMPILE_IFELSE(
1100           [AC_LANG_SOURCE(
1101              [[#if defined __powerpc64__ || defined _ARCH_PPC64
1102                 int ok;
1103                #else
1104                 error fail
1105                #endif
1106              ]])],
1107           [# On powerpc64, there are two ABIs on Linux: The AIX compatible
1108            # one and the ELFv2 one. The latter defines _CALL_ELF=2.
1109            AC_COMPILE_IFELSE(
1110              [AC_LANG_SOURCE(
1111                 [[#if defined _CALL_ELF && _CALL_ELF == 2
1112                    int ok;
1113                   #else
1114                    error fail
1115                   #endif
1116                 ]])],
1117              [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
1118              [gl_cv_host_cpu_c_abi=powerpc64])
1119           ],
1120           [gl_cv_host_cpu_c_abi=powerpc])
1121         ;;
1122
1123       rs6000 )
1124         gl_cv_host_cpu_c_abi=powerpc
1125         ;;
1126
1127       riscv32 | riscv64 )
1128         # There are 2 architectures (with variants): rv32* and rv64*.
1129         AC_COMPILE_IFELSE(
1130           [AC_LANG_SOURCE(
1131              [[#if __riscv_xlen == 64
1132                  int ok;
1133                #else
1134                  error fail
1135                #endif
1136              ]])],
1137           [cpu=riscv64],
1138           [cpu=riscv32])
1139         # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
1140         # Size of 'long' and 'void *':
1141         AC_COMPILE_IFELSE(
1142           [AC_LANG_SOURCE(
1143              [[#if defined __LP64__
1144                  int ok;
1145                #else
1146                  error fail
1147                #endif
1148              ]])],
1149           [main_abi=lp64],
1150           [main_abi=ilp32])
1151         # Float ABIs:
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.
1158         AC_COMPILE_IFELSE(
1159           [AC_LANG_SOURCE(
1160              [[#if defined __riscv_float_abi_double
1161                  int ok;
1162                #else
1163                  error fail
1164                #endif
1165              ]])],
1166           [float_abi=d],
1167           [AC_COMPILE_IFELSE(
1168              [AC_LANG_SOURCE(
1169                 [[#if defined __riscv_float_abi_single
1170                     int ok;
1171                   #else
1172                     error fail
1173                   #endif
1174                 ]])],
1175              [float_abi=f],
1176              [float_abi=''])
1177           ])
1178         gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
1179         ;;
1180
1181       s390* )
1182         # On s390x, the C compiler may be generating 64-bit (= s390x) code
1183         # or 31-bit (= s390) code.
1184         AC_COMPILE_IFELSE(
1185           [AC_LANG_SOURCE(
1186              [[#if defined __LP64__ || defined __s390x__
1187                  int ok;
1188                #else
1189                  error fail
1190                #endif
1191              ]])],
1192           [gl_cv_host_cpu_c_abi=s390x],
1193           [gl_cv_host_cpu_c_abi=s390])
1194         ;;
1195
1196       sparc | sparc64 )
1197         # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
1198         # C compiler still generates 32-bit code.
1199         AC_COMPILE_IFELSE(
1200           [AC_LANG_SOURCE(
1201              [[#if defined __sparcv9 || defined __arch64__
1202                 int ok;
1203                #else
1204                 error fail
1205                #endif
1206              ]])],
1207           [gl_cv_host_cpu_c_abi=sparc64],
1208           [gl_cv_host_cpu_c_abi=sparc])
1209         ;;
1210
1211       *)
1212         gl_cv_host_cpu_c_abi="$host_cpu"
1213         ;;
1214     esac
1215    ])
1216
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])
1222
1223  # This was
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
1230#endif
1231#ifndef __${HOST_CPU_C_ABI}__
1232#define __${HOST_CPU_C_ABI}__ 1
1233#endif
1234EOF
1235  AH_TOP([/* CPU and C ABI indicator */
1236#ifndef __i386__
1237#undef __i386__
1238#endif
1239#ifndef __x86_64_x32__
1240#undef __x86_64_x32__
1241#endif
1242#ifndef __x86_64__
1243#undef __x86_64__
1244#endif
1245#ifndef __alpha__
1246#undef __alpha__
1247#endif
1248#ifndef __arm__
1249#undef __arm__
1250#endif
1251#ifndef __armhf__
1252#undef __armhf__
1253#endif
1254#ifndef __arm64_ilp32__
1255#undef __arm64_ilp32__
1256#endif
1257#ifndef __arm64__
1258#undef __arm64__
1259#endif
1260#ifndef __hppa__
1261#undef __hppa__
1262#endif
1263#ifndef __hppa64__
1264#undef __hppa64__
1265#endif
1266#ifndef __ia64_ilp32__
1267#undef __ia64_ilp32__
1268#endif
1269#ifndef __ia64__
1270#undef __ia64__
1271#endif
1272#ifndef __m68k__
1273#undef __m68k__
1274#endif
1275#ifndef __mips__
1276#undef __mips__
1277#endif
1278#ifndef __mipsn32__
1279#undef __mipsn32__
1280#endif
1281#ifndef __mips64__
1282#undef __mips64__
1283#endif
1284#ifndef __powerpc__
1285#undef __powerpc__
1286#endif
1287#ifndef __powerpc64__
1288#undef __powerpc64__
1289#endif
1290#ifndef __powerpc64_elfv2__
1291#undef __powerpc64_elfv2__
1292#endif
1293#ifndef __riscv32__
1294#undef __riscv32__
1295#endif
1296#ifndef __riscv64__
1297#undef __riscv64__
1298#endif
1299#ifndef __riscv32_ilp32__
1300#undef __riscv32_ilp32__
1301#endif
1302#ifndef __riscv32_ilp32f__
1303#undef __riscv32_ilp32f__
1304#endif
1305#ifndef __riscv32_ilp32d__
1306#undef __riscv32_ilp32d__
1307#endif
1308#ifndef __riscv64_ilp32__
1309#undef __riscv64_ilp32__
1310#endif
1311#ifndef __riscv64_ilp32f__
1312#undef __riscv64_ilp32f__
1313#endif
1314#ifndef __riscv64_ilp32d__
1315#undef __riscv64_ilp32d__
1316#endif
1317#ifndef __riscv64_lp64__
1318#undef __riscv64_lp64__
1319#endif
1320#ifndef __riscv64_lp64f__
1321#undef __riscv64_lp64f__
1322#endif
1323#ifndef __riscv64_lp64d__
1324#undef __riscv64_lp64d__
1325#endif
1326#ifndef __s390__
1327#undef __s390__
1328#endif
1329#ifndef __s390x__
1330#undef __s390x__
1331#endif
1332#ifndef __sh__
1333#undef __sh__
1334#endif
1335#ifndef __sparc__
1336#undef __sparc__
1337#endif
1338#ifndef __sparc64__
1339#undef __sparc64__
1340#endif
1341])
1342
1343])
1344
1345
1346dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
1347dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
1348dnl one, or to 'unknown' if unknown.
1349dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
1350AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
1351[
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 ;;
1360         *)
1361           gl_cv_host_cpu_c_abi_32bit=unknown ;;
1362       esac
1363     else
1364       case "$host_cpu" in
1365
1366         # CPUs that only support a 32-bit ABI.
1367         arc \
1368         | bfin \
1369         | cris* \
1370         | csky \
1371         | epiphany \
1372         | ft32 \
1373         | h8300 \
1374         | m68k \
1375         | microblaze | microblazeel \
1376         | nds32 | nds32le | nds32be \
1377         | nios2 | nios2eb | nios2el \
1378         | or1k* \
1379         | or32 \
1380         | sh | sh[1234] | sh[1234]e[lb] \
1381         | tic6x \
1382         | xtensa* )
1383           gl_cv_host_cpu_c_abi_32bit=yes
1384           ;;
1385
1386         # CPUs that only support a 64-bit ABI.
1387changequote(,)dnl
1388         alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
1389         | mmix )
1390changequote([,])dnl
1391           gl_cv_host_cpu_c_abi_32bit=no
1392           ;;
1393
1394changequote(,)dnl
1395         i[34567]86 )
1396changequote([,])dnl
1397           gl_cv_host_cpu_c_abi_32bit=yes
1398           ;;
1399
1400         x86_64 )
1401           # On x86_64 systems, the C compiler may be generating code in one of
1402           # these ABIs:
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.
1408           AC_COMPILE_IFELSE(
1409             [AC_LANG_SOURCE(
1410                [[#if (defined __x86_64__ || defined __amd64__ \
1411                       || defined _M_X64 || defined _M_AMD64) \
1412                      && !(defined __ILP32__ || defined _ILP32)
1413                   int ok;
1414                  #else
1415                   error fail
1416                  #endif
1417                ]])],
1418             [gl_cv_host_cpu_c_abi_32bit=no],
1419             [gl_cv_host_cpu_c_abi_32bit=yes])
1420           ;;
1421
1422         arm* | aarch64 )
1423           # Assume arm with EABI.
1424           # On arm64 systems, the C compiler may be generating code in one of
1425           # these ABIs:
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.
1429           AC_COMPILE_IFELSE(
1430             [AC_LANG_SOURCE(
1431                [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
1432                   int ok;
1433                  #else
1434                   error fail
1435                  #endif
1436                ]])],
1437             [gl_cv_host_cpu_c_abi_32bit=no],
1438             [gl_cv_host_cpu_c_abi_32bit=yes])
1439           ;;
1440
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__.
1444           AC_COMPILE_IFELSE(
1445             [AC_LANG_SOURCE(
1446                [[#ifdef __LP64__
1447                   int ok;
1448                  #else
1449                   error fail
1450                  #endif
1451                ]])],
1452             [gl_cv_host_cpu_c_abi_32bit=no],
1453             [gl_cv_host_cpu_c_abi_32bit=yes])
1454           ;;
1455
1456         ia64* )
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.
1459           AC_COMPILE_IFELSE(
1460             [AC_LANG_SOURCE(
1461                [[#ifdef _ILP32
1462                   int ok;
1463                  #else
1464                   error fail
1465                  #endif
1466                ]])],
1467             [gl_cv_host_cpu_c_abi_32bit=yes],
1468             [gl_cv_host_cpu_c_abi_32bit=no])
1469           ;;
1470
1471         mips* )
1472           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
1473           # at 32.
1474           AC_COMPILE_IFELSE(
1475             [AC_LANG_SOURCE(
1476                [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
1477                   int ok;
1478                  #else
1479                   error fail
1480                  #endif
1481                ]])],
1482             [gl_cv_host_cpu_c_abi_32bit=no],
1483             [gl_cv_host_cpu_c_abi_32bit=yes])
1484           ;;
1485
1486         powerpc* )
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.
1493           AC_COMPILE_IFELSE(
1494             [AC_LANG_SOURCE(
1495                [[#if defined __powerpc64__ || defined _ARCH_PPC64
1496                   int ok;
1497                  #else
1498                   error fail
1499                  #endif
1500                ]])],
1501             [gl_cv_host_cpu_c_abi_32bit=no],
1502             [gl_cv_host_cpu_c_abi_32bit=yes])
1503           ;;
1504
1505         rs6000 )
1506           gl_cv_host_cpu_c_abi_32bit=yes
1507           ;;
1508
1509         riscv32 | riscv64 )
1510           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
1511           # Size of 'long' and 'void *':
1512           AC_COMPILE_IFELSE(
1513             [AC_LANG_SOURCE(
1514                [[#if defined __LP64__
1515                    int ok;
1516                  #else
1517                    error fail
1518                  #endif
1519                ]])],
1520             [gl_cv_host_cpu_c_abi_32bit=no],
1521             [gl_cv_host_cpu_c_abi_32bit=yes])
1522           ;;
1523
1524         s390* )
1525           # On s390x, the C compiler may be generating 64-bit (= s390x) code
1526           # or 31-bit (= s390) code.
1527           AC_COMPILE_IFELSE(
1528             [AC_LANG_SOURCE(
1529                [[#if defined __LP64__ || defined __s390x__
1530                    int ok;
1531                  #else
1532                    error fail
1533                  #endif
1534                ]])],
1535             [gl_cv_host_cpu_c_abi_32bit=no],
1536             [gl_cv_host_cpu_c_abi_32bit=yes])
1537           ;;
1538
1539         sparc | sparc64 )
1540           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
1541           # C compiler still generates 32-bit code.
1542           AC_COMPILE_IFELSE(
1543             [AC_LANG_SOURCE(
1544                [[#if defined __sparcv9 || defined __arch64__
1545                   int ok;
1546                  #else
1547                   error fail
1548                  #endif
1549                ]])],
1550             [gl_cv_host_cpu_c_abi_32bit=no],
1551             [gl_cv_host_cpu_c_abi_32bit=yes])
1552           ;;
1553
1554         *)
1555           gl_cv_host_cpu_c_abi_32bit=unknown
1556           ;;
1557       esac
1558     fi
1559    ])
1560
1561  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
1562])
1563
1564# iconv.m4 serial 21
1565dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
1566dnl Inc.
1567dnl This file is free software; the Free Software Foundation
1568dnl gives unlimited permission to copy and/or distribute it,
1569dnl with or without modifications, as long as this notice is preserved.
1570
1571dnl From Bruno Haible.
1572
1573AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1574[
1575  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1576  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1577  AC_REQUIRE([AC_LIB_RPATH])
1578
1579  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1580  dnl accordingly.
1581  AC_LIB_LINKFLAGS_BODY([iconv])
1582])
1583
1584AC_DEFUN([AM_ICONV_LINK],
1585[
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
1589
1590  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1591  dnl accordingly.
1592  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1593
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])
1600
1601  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
1602    am_cv_func_iconv="no, consider installing GNU libiconv"
1603    am_cv_lib_iconv=no
1604    AC_LINK_IFELSE(
1605      [AC_LANG_PROGRAM(
1606         [[
1607#include <stdlib.h>
1608#include <iconv.h>
1609         ]],
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"
1617      AC_LINK_IFELSE(
1618        [AC_LANG_PROGRAM(
1619           [[
1620#include <stdlib.h>
1621#include <iconv.h>
1622           ]],
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"
1629    fi
1630  ])
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,
1634      dnl Solaris 10.
1635      am_save_LIBS="$LIBS"
1636      if test $am_cv_lib_iconv = yes; then
1637        LIBS="$LIBS $LIBICONV"
1638      fi
1639      am_cv_func_iconv_works=no
1640      for ac_iconv_const in '' 'const'; do
1641        AC_RUN_IFELSE(
1642          [AC_LANG_PROGRAM(
1643             [[
1644#include <iconv.h>
1645#include <string.h>
1646
1647#ifndef ICONV_CONST
1648# define ICONV_CONST $ac_iconv_const
1649#endif
1650             ]],
1651             [[int result = 0;
1652  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
1653     returns.  */
1654  {
1655    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
1656    if (cd_utf8_to_88591 != (iconv_t)(-1))
1657      {
1658        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
1659        char buf[10];
1660        ICONV_CONST char *inptr = input;
1661        size_t inbytesleft = strlen (input);
1662        char *outptr = buf;
1663        size_t outbytesleft = sizeof (buf);
1664        size_t res = iconv (cd_utf8_to_88591,
1665                            &inptr, &inbytesleft,
1666                            &outptr, &outbytesleft);
1667        if (res == 0)
1668          result |= 1;
1669        iconv_close (cd_utf8_to_88591);
1670      }
1671  }
1672  /* Test against Solaris 10 bug: Failures are not distinguishable from
1673     successful returns.  */
1674  {
1675    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
1676    if (cd_ascii_to_88591 != (iconv_t)(-1))
1677      {
1678        static ICONV_CONST char input[] = "\263";
1679        char buf[10];
1680        ICONV_CONST char *inptr = input;
1681        size_t inbytesleft = strlen (input);
1682        char *outptr = buf;
1683        size_t outbytesleft = sizeof (buf);
1684        size_t res = iconv (cd_ascii_to_88591,
1685                            &inptr, &inbytesleft,
1686                            &outptr, &outbytesleft);
1687        if (res == 0)
1688          result |= 2;
1689        iconv_close (cd_ascii_to_88591);
1690      }
1691  }
1692  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
1693  {
1694    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
1695    if (cd_88591_to_utf8 != (iconv_t)(-1))
1696      {
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;
1701        char *outptr = buf;
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)
1707          result |= 4;
1708        iconv_close (cd_88591_to_utf8);
1709      }
1710  }
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.  */
1713  {
1714    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
1715    if (cd_88591_to_utf8 != (iconv_t)(-1))
1716      {
1717        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
1718        char buf[50];
1719        ICONV_CONST char *inptr = input;
1720        size_t inbytesleft = strlen (input);
1721        char *outptr = buf;
1722        size_t outbytesleft = sizeof (buf);
1723        size_t res = iconv (cd_88591_to_utf8,
1724                            &inptr, &inbytesleft,
1725                            &outptr, &outbytesleft);
1726        if ((int)res > 0)
1727          result |= 8;
1728        iconv_close (cd_88591_to_utf8);
1729      }
1730  }
1731#endif
1732  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
1733     provided.  */
1734  {
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))
1745      result |= 16;
1746    if (cd1 != (iconv_t)(-1))
1747      iconv_close (cd1);
1748    if (cd2 != (iconv_t)(-1))
1749      iconv_close (cd2);
1750    if (cd3 != (iconv_t)(-1))
1751      iconv_close (cd3);
1752    if (cd4 != (iconv_t)(-1))
1753      iconv_close (cd4);
1754  }
1755  return result;
1756]])],
1757          [am_cv_func_iconv_works=yes], ,
1758          [case "$host_os" in
1759             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
1760             *)            am_cv_func_iconv_works="guessing yes" ;;
1761           esac])
1762        test "$am_cv_func_iconv_works" = no || break
1763      done
1764      LIBS="$am_save_LIBS"
1765    ])
1766    case "$am_cv_func_iconv_works" in
1767      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
1768      *)   am_func_iconv=yes ;;
1769    esac
1770  else
1771    am_func_iconv=no am_cv_lib_iconv=no
1772  fi
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.])
1776  fi
1777  if test "$am_cv_lib_iconv" = yes; then
1778    AC_MSG_CHECKING([how to link with libiconv])
1779    AC_MSG_RESULT([$LIBICONV])
1780  else
1781    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1782    dnl either.
1783    CPPFLAGS="$am_save_CPPFLAGS"
1784    LIBICONV=
1785    LTLIBICONV=
1786  fi
1787  AC_SUBST([LIBICONV])
1788  AC_SUBST([LTLIBICONV])
1789])
1790
1791dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
1792dnl avoid warnings like
1793dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
1794dnl This is tricky because of the way 'aclocal' is implemented:
1795dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
1796dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
1797dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
1798dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
1799dnl   warnings.
1800m4_define([gl_iconv_AC_DEFUN],
1801  m4_version_prereq([2.64],
1802    [[AC_DEFUN_ONCE(
1803        [$1], [$2])]],
1804    [m4_ifdef([gl_00GNULIB],
1805       [[AC_DEFUN_ONCE(
1806           [$1], [$2])]],
1807       [[AC_DEFUN(
1808           [$1], [$2])]])]))
1809gl_iconv_AC_DEFUN([AM_ICONV],
1810[
1811  AM_ICONV_LINK
1812  if test "$am_cv_func_iconv" = yes; then
1813    AC_MSG_CHECKING([for iconv declaration])
1814    AC_CACHE_VAL([am_cv_proto_iconv], [
1815      AC_COMPILE_IFELSE(
1816        [AC_LANG_PROGRAM(
1817           [[
1818#include <stdlib.h>
1819#include <iconv.h>
1820extern
1821#ifdef __cplusplus
1822"C"
1823#endif
1824#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
1825size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1826#else
1827size_t iconv();
1828#endif
1829           ]],
1830           [[]])],
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/( /(/'`
1835    AC_MSG_RESULT([
1836         $am_cv_proto_iconv])
1837  else
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=""
1841  fi
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
1848       ICONV_CONST="const"
1849     fi
1850    ])
1851])
1852
1853# intlmacosx.m4 serial 8 (gettext-0.20.2)
1854dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc.
1855dnl This file is free software; the Free Software Foundation
1856dnl gives unlimited permission to copy and/or distribute it,
1857dnl with or without modifications, as long as this notice is preserved.
1858dnl
1859dnl This file can be used in projects which are not available under
1860dnl the GNU General Public License or the GNU Lesser General Public
1861dnl License but which still want to provide support for the GNU gettext
1862dnl functionality.
1863dnl Please note that the actual code of the GNU gettext library is covered
1864dnl by the GNU Lesser General Public License, and the rest of the GNU
1865dnl gettext package is covered by the GNU General Public License.
1866dnl They are *not* in the public domain.
1867
1868dnl Checks for special options needed on Mac OS X.
1869dnl Defines INTL_MACOSX_LIBS.
1870AC_DEFUN([gt_INTL_MACOSX],
1871[
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"
1877     AC_LINK_IFELSE(
1878       [AC_LANG_PROGRAM(
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.])
1887  fi
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"
1900     AC_LINK_IFELSE(
1901       [AC_LANG_PROGRAM(
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.])
1910  fi
1911  INTL_MACOSX_LIBS=
1912  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
1913     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
1914    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1915  fi
1916  AC_SUBST([INTL_MACOSX_LIBS])
1917])
1918
1919# lib-ld.m4 serial 9
1920dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc.
1921dnl This file is free software; the Free Software Foundation
1922dnl gives unlimited permission to copy and/or distribute it,
1923dnl with or without modifications, as long as this notice is preserved.
1924
1925dnl Subroutines of libtool.m4,
1926dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
1927dnl collision with libtool.m4.
1928
1929dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
1930AC_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.
1933case `$LD -v 2>&1 </dev/null` in
1934*GNU* | *'with BFD'*)
1935  acl_cv_prog_gnu_ld=yes
1936  ;;
1937*)
1938  acl_cv_prog_gnu_ld=no
1939  ;;
1940esac])
1941with_gnu_ld=$acl_cv_prog_gnu_ld
1942])
1943
1944dnl From libtool-2.4. Sets the variable LD.
1945AC_DEFUN([AC_LIB_PROG_LD],
1946[AC_REQUIRE([AC_PROG_CC])dnl
1947AC_REQUIRE([AC_CANONICAL_HOST])dnl
1948
1949AC_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
1954
1955# Prepare PATH_SEPARATOR.
1956# The user is always right.
1957if 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.
1961  PATH_SEPARATOR=:
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=';'
1965       }
1966fi
1967
1968if test -n "$LD"; then
1969  AC_MSG_CHECKING([for ld])
1970elif test "$GCC" = yes; then
1971  AC_MSG_CHECKING([for ld used by $CC])
1972elif test "$with_gnu_ld" = yes; then
1973  AC_MSG_CHECKING([for GNU ld])
1974else
1975  AC_MSG_CHECKING([for non-GNU ld])
1976fi
1977if test -n "$LD"; then
1978  # Let the user override the test with a path.
1979  :
1980else
1981  AC_CACHE_VAL([acl_cv_path_LD],
1982  [
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.
1987      case $host in
1988        *-*-mingw*)
1989          # gcc leaves a trailing carriage return which upsets mingw
1990          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1991        *)
1992          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
1993      esac
1994      case $acl_output in
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%/%"`
2002          done
2003          # Got the pathname. No search in PATH is needed.
2004          acl_cv_path_LD="$acl_output"
2005          ac_prog=
2006          ;;
2007        "")
2008          # If it fails, then pretend we aren't using GCC.
2009          ;;
2010        *)
2011          # If it is relative, then search for the first ld in PATH.
2012          with_gnu_ld=unknown
2013          ;;
2014      esac
2015    fi
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
2020        IFS="$acl_save_ifs"
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
2030              ;;
2031            *)
2032              test "$with_gnu_ld" != yes && break
2033              ;;
2034          esac
2035        fi
2036      done
2037      IFS="$acl_save_ifs"
2038    fi
2039    case $host in
2040      *-*-aix*)
2041        AC_COMPILE_IFELSE(
2042          [AC_LANG_SOURCE(
2043             [[#if defined __powerpc64__ || defined _ARCH_PPC64
2044                int ok;
2045               #else
2046                error fail
2047               #endif
2048             ]])],
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
2052             *" -b64 "*) ;;
2053             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
2054           esac
2055          ], [])
2056        ;;
2057      sparc64-*-netbsd*)
2058        AC_COMPILE_IFELSE(
2059          [AC_LANG_SOURCE(
2060             [[#if defined __sparcv9 || defined __arch64__
2061                int ok;
2062               #else
2063                error fail
2064               #endif
2065             ]])],
2066          [],
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" ;;
2072           esac
2073          ])
2074        ;;
2075    esac
2076  ])
2077  LD="$acl_cv_path_LD"
2078fi
2079if test -n "$LD"; then
2080  AC_MSG_RESULT([$LD])
2081else
2082  AC_MSG_RESULT([no])
2083  AC_MSG_ERROR([no acceptable ld found in \$PATH])
2084fi
2085AC_LIB_PROG_LD_GNU
2086])
2087
2088# lib-link.m4 serial 31
2089dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
2090dnl This file is free software; the Free Software Foundation
2091dnl gives unlimited permission to copy and/or distribute it,
2092dnl with or without modifications, as long as this notice is preserved.
2093
2094dnl From Bruno Haible.
2095
2096AC_PREREQ([2.61])
2097
2098dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
2099dnl the libraries corresponding to explicit and implicit dependencies.
2100dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
2101dnl augments the CPPFLAGS variable.
2102dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
2103dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2104AC_DEFUN([AC_LIB_LINKFLAGS],
2105[
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"
2117  ])
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)
2123  AC_SUBST([LIB]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.
2128  HAVE_LIB[]NAME=yes
2129  popdef([NAME])
2130  popdef([Name])
2131])
2132
2133dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
2134dnl searches for libname and the libraries corresponding to explicit and
2135dnl implicit dependencies, together with the specified include files and
2136dnl the ability to compile and link the specified testcode. The missing-message
2137dnl defaults to 'no' and may contain additional hints for the user.
2138dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
2139dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2140dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2141dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2142dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
2143dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2144AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2145[
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____])])
2151
2152  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2153  dnl accordingly.
2154  AC_LIB_LINKFLAGS_BODY([$1], [$2])
2155
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)
2161
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
2170    dnl it.
2171    case " $LIB[]NAME" in
2172      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
2173      *)       LIBS="$LIB[]NAME $LIBS" ;;
2174    esac
2175    AC_LINK_IFELSE(
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"
2180  ])
2181  if test "$ac_cv_lib[]Name" = yes; then
2182    HAVE_LIB[]NAME=yes
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])
2186  else
2187    HAVE_LIB[]NAME=no
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"
2191    LIB[]NAME=
2192    LTLIB[]NAME=
2193    LIB[]NAME[]_PREFIX=
2194  fi
2195  AC_SUBST([HAVE_LIB]NAME)
2196  AC_SUBST([LIB]NAME)
2197  AC_SUBST([LTLIB]NAME)
2198  AC_SUBST([LIB]NAME[_PREFIX])
2199  popdef([NAME])
2200  popdef([Name])
2201])
2202
2203dnl Determine the platform dependent parameters needed to use rpath:
2204dnl   acl_libext,
2205dnl   acl_shlibext,
2206dnl   acl_libname_spec,
2207dnl   acl_library_names_spec,
2208dnl   acl_hardcode_libdir_flag_spec,
2209dnl   acl_hardcode_libdir_separator,
2210dnl   acl_hardcode_direct,
2211dnl   acl_hardcode_minus_L.
2212AC_DEFUN([AC_LIB_RPATH],
2213[
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
2223    . ./conftest.sh
2224    rm -f ./conftest.sh
2225    acl_cv_rpath=done
2226  ])
2227  wl="$acl_cv_wl"
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)
2240])
2241
2242dnl AC_LIB_FROMPACKAGE(name, package)
2243dnl declares that libname comes from the given package. The configure file
2244dnl will then not have a --with-libname-prefix option but a
2245dnl --with-package-prefix option. Several libraries can come from the same
2246dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
2247dnl macro call that searches for libname.
2248AC_DEFUN([AC_LIB_FROMPACKAGE],
2249[
2250  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2251                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2252  define([acl_frompackage_]NAME, [$2])
2253  popdef([NAME])
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])
2259  popdef([PACKUP])
2260  popdef([PACK])
2261])
2262
2263dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2264dnl the libraries corresponding to explicit and implicit dependencies.
2265dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2266dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
2267dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2268AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2269[
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.
2278  use_additional=yes
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\"
2284  ])
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]],
2288[
2289    if test "X$withval" = "Xno"; then
2290      use_additional=no
2291    else
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\"
2298        ])
2299      else
2300        additional_includedir="$withval/include"
2301        additional_libdir="$withval/$acl_libdirstem"
2302        additional_libdir2="$withval/$acl_libdirstem2"
2303        additional_libdir3="$withval/$acl_libdirstem3"
2304      fi
2305    fi
2306])
2307  if test "X$additional_libdir2" = "X$additional_libdir"; then
2308    additional_libdir2=
2309  fi
2310  if test "X$additional_libdir3" = "X$additional_libdir"; then
2311    additional_libdir3=
2312  fi
2313  dnl Search the library and its dependencies in $additional_libdir and
2314  dnl $LDFLAGS. Using breadth-first-seach.
2315  LIB[]NAME=
2316  LTLIB[]NAME=
2317  INC[]NAME=
2318  LIB[]NAME[]_PREFIX=
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.
2321  HAVE_LIB[]NAME=
2322  rpathdirs=
2323  ltrpathdirs=
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"
2328    names_next_round=
2329    for name in $names_this_round; do
2330      already_handled=
2331      for n in $names_already_handled; do
2332        if test "$n" = "$name"; then
2333          already_handled=yes
2334          break
2335        fi
2336      done
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"
2349          else
2350            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2351            dnl that this library doesn't exist. So just drop it.
2352            :
2353          fi
2354        else
2355          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2356          dnl and the already constructed $LIBNAME/$LTLIBNAME.
2357          found_dir=
2358          found_la=
2359          found_so=
2360          found_a=
2361          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
2362          if test -n "$acl_shlibext"; then
2363            shrext=".$acl_shlibext"             # typically: shrext=.so
2364          else
2365            shrext=
2366          fi
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
2376                      found_dir="$dir"
2377                      found_so="$dir/$libname$shrext"
2378                    else
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
2386                          found_dir="$dir"
2387                          found_so="$dir/$libname$shrext.$ver"
2388                        fi
2389                      else
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
2393                            found_dir="$dir"
2394                            found_so="$dir/$f"
2395                            break
2396                          fi
2397                        done
2398                      fi
2399                    fi
2400                  fi
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
2404                      found_dir="$dir"
2405                      found_a="$dir/$libname.$acl_libext"
2406                    fi
2407                  fi
2408                  if test "X$found_dir" != "X"; then
2409                    if test -f "$dir/$libname.la"; then
2410                      found_la="$dir/$libname.la"
2411                    fi
2412                  fi
2413                fi
2414              fi
2415            done
2416          fi
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\"])
2420              case "$x" in
2421                -L*)
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
2426                      found_dir="$dir"
2427                      found_so="$dir/$libname$shrext"
2428                    else
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
2436                          found_dir="$dir"
2437                          found_so="$dir/$libname$shrext.$ver"
2438                        fi
2439                      else
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
2443                            found_dir="$dir"
2444                            found_so="$dir/$f"
2445                            break
2446                          fi
2447                        done
2448                      fi
2449                    fi
2450                  fi
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
2454                      found_dir="$dir"
2455                      found_a="$dir/$libname.$acl_libext"
2456                    fi
2457                  fi
2458                  if test "X$found_dir" != "X"; then
2459                    if test -f "$dir/$libname.la"; then
2460                      found_la="$dir/$libname.la"
2461                    fi
2462                  fi
2463                  ;;
2464              esac
2465              if test "X$found_dir" != "X"; then
2466                break
2467              fi
2468            done
2469          fi
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"
2483              else
2484                dnl Use an explicit option to hardcode DIR into the resulting
2485                dnl binary.
2486                dnl Potentially add DIR to ltrpathdirs.
2487                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2488                haveit=
2489                for x in $ltrpathdirs; do
2490                  if test "X$x" = "X$found_dir"; then
2491                    haveit=yes
2492                    break
2493                  fi
2494                done
2495                if test -z "$haveit"; then
2496                  ltrpathdirs="$ltrpathdirs $found_dir"
2497                fi
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"
2503                else
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
2506                    dnl binary.
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.
2510                    haveit=
2511                    for x in $rpathdirs; do
2512                      if test "X$x" = "X$found_dir"; then
2513                        haveit=yes
2514                        break
2515                      fi
2516                    done
2517                    if test -z "$haveit"; then
2518                      rpathdirs="$rpathdirs $found_dir"
2519                    fi
2520                  else
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
2524                    haveit=
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
2528                        haveit=yes
2529                        break
2530                      fi
2531                    done
2532                    if test -z "$haveit"; then
2533                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2534                    fi
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"
2538                      dnl here.
2539                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2540                    else
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"
2547                      dnl here.
2548                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2549                    fi
2550                  fi
2551                fi
2552              fi
2553            else
2554              if test "X$found_a" != "X"; then
2555                dnl Linking with a static library.
2556                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2557              else
2558                dnl We shouldn't come here, but anyway it's good to have a
2559                dnl fallback.
2560                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2561              fi
2562            fi
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"
2570                fi
2571                additional_includedir="$basedir/include"
2572                ;;
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"
2577                fi
2578                additional_includedir="$basedir/include"
2579                ;;
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"
2584                fi
2585                additional_includedir="$basedir/include"
2586                ;;
2587            esac
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
2597                haveit=
2598                if test "X$additional_includedir" = "X/usr/local/include"; then
2599                  if test -n "$GCC"; then
2600                    case $host_os in
2601                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2602                    esac
2603                  fi
2604                fi
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
2609                      haveit=yes
2610                      break
2611                    fi
2612                  done
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"
2617                    fi
2618                  fi
2619                fi
2620              fi
2621            fi
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"
2628              case "$found_la" in
2629                */* | *\\*) . "$found_la" ;;
2630                *) . "./$found_la" ;;
2631              esac
2632              libdir="$save_libdir"
2633              dnl We use only dependency_libs.
2634              for dep in $dependency_libs; do
2635                case "$dep" in
2636                  -L*)
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
2648                      haveit=
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
2653                          case $host_os in
2654                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2655                          esac
2656                        fi
2657                      fi
2658                      if test -z "$haveit"; then
2659                        haveit=
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
2663                            haveit=yes
2664                            break
2665                          fi
2666                        done
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"
2671                          fi
2672                        fi
2673                        haveit=
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
2677                            haveit=yes
2678                            break
2679                          fi
2680                        done
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"
2685                          fi
2686                        fi
2687                      fi
2688                    fi
2689                    ;;
2690                  -R*)
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.
2695                      haveit=
2696                      for x in $rpathdirs; do
2697                        if test "X$x" = "X$dir"; then
2698                          haveit=yes
2699                          break
2700                        fi
2701                      done
2702                      if test -z "$haveit"; then
2703                        rpathdirs="$rpathdirs $dir"
2704                      fi
2705                      dnl Potentially add DIR to ltrpathdirs.
2706                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2707                      haveit=
2708                      for x in $ltrpathdirs; do
2709                        if test "X$x" = "X$dir"; then
2710                          haveit=yes
2711                          break
2712                        fi
2713                      done
2714                      if test -z "$haveit"; then
2715                        ltrpathdirs="$ltrpathdirs $dir"
2716                      fi
2717                    fi
2718                    ;;
2719                  -l*)
2720                    dnl Handle this in the next round.
2721                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2722                    ;;
2723                  *.la)
2724                    dnl Handle this in the next round. Throw away the .la's
2725                    dnl directory; it is already contained in a preceding -L
2726                    dnl option.
2727                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2728                    ;;
2729                  *)
2730                    dnl Most likely an immediate library name.
2731                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2732                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2733                    ;;
2734                esac
2735              done
2736            fi
2737          else
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"
2744          fi
2745        fi
2746      fi
2747    done
2748  done
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.
2754      alldirs=
2755      for found_dir in $rpathdirs; do
2756        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
2757      done
2758      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
2759      acl_save_libdir="$libdir"
2760      libdir="$alldirs"
2761      eval flag=\"$acl_hardcode_libdir_flag_spec\"
2762      libdir="$acl_save_libdir"
2763      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2764    else
2765      dnl The -rpath options are cumulative.
2766      for found_dir in $rpathdirs; do
2767        acl_save_libdir="$libdir"
2768        libdir="$found_dir"
2769        eval flag=\"$acl_hardcode_libdir_flag_spec\"
2770        libdir="$acl_save_libdir"
2771        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2772      done
2773    fi
2774  fi
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"
2780    done
2781  fi
2782  popdef([PACKLIBS])
2783  popdef([PACKUP])
2784  popdef([PACK])
2785  popdef([NAME])
2786])
2787
2788dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2789dnl unless already present in VAR.
2790dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2791dnl contains two or three consecutive elements that belong together.
2792AC_DEFUN([AC_LIB_APPENDTOVAR],
2793[
2794  for element in [$2]; do
2795    haveit=
2796    for x in $[$1]; do
2797      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2798      if test "X$x" = "X$element"; then
2799        haveit=yes
2800        break
2801      fi
2802    done
2803    if test -z "$haveit"; then
2804      [$1]="${[$1]}${[$1]:+ }$element"
2805    fi
2806  done
2807])
2808
2809dnl For those cases where a variable contains several -L and -l options
2810dnl referring to unknown libraries and directories, this macro determines the
2811dnl necessary additional linker options for the runtime path.
2812dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
2813dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
2814dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
2815dnl otherwise linking without libtool is assumed.
2816AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
2817[
2818  AC_REQUIRE([AC_LIB_RPATH])
2819  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2820  $1=
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
2824      dnl binary.
2825      rpathdirs=
2826      next=
2827      for opt in $2; do
2828        if test -n "$next"; then
2829          dir="$next"
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"
2835          fi
2836          next=
2837        else
2838          case $opt in
2839            -L) next=yes ;;
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"
2846                 fi
2847                 next= ;;
2848            *) next= ;;
2849          esac
2850        fi
2851      done
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"
2857          done
2858        else
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.
2863            alldirs=
2864            for dir in $rpathdirs; do
2865              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
2866            done
2867            acl_save_libdir="$libdir"
2868            libdir="$alldirs"
2869            eval flag=\"$acl_hardcode_libdir_flag_spec\"
2870            libdir="$acl_save_libdir"
2871            $1="$flag"
2872          else
2873            dnl The -rpath options are cumulative.
2874            for dir in $rpathdirs; do
2875              acl_save_libdir="$libdir"
2876              libdir="$dir"
2877              eval flag=\"$acl_hardcode_libdir_flag_spec\"
2878              libdir="$acl_save_libdir"
2879              $1="${$1}${$1:+ }$flag"
2880            done
2881          fi
2882        fi
2883      fi
2884    fi
2885  fi
2886  AC_SUBST([$1])
2887])
2888
2889# lib-prefix.m4 serial 17
2890dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc.
2891dnl This file is free software; the Free Software Foundation
2892dnl gives unlimited permission to copy and/or distribute it,
2893dnl with or without modifications, as long as this notice is preserved.
2894
2895dnl From Bruno Haible.
2896
2897dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2898dnl to access previously installed libraries. The basic assumption is that
2899dnl a user will want packages to use other packages he previously installed
2900dnl with the same --prefix option.
2901dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2902dnl libraries, but is otherwise very convenient.
2903AC_DEFUN([AC_LIB_PREFIX],
2904[
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.
2911  use_additional=yes
2912  AC_LIB_WITH_FINAL_PREFIX([
2913    eval additional_includedir=\"$includedir\"
2914    eval additional_libdir=\"$libdir\"
2915  ])
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]],
2919[
2920    if test "X$withval" = "Xno"; then
2921      use_additional=no
2922    else
2923      if test "X$withval" = "X"; then
2924        AC_LIB_WITH_FINAL_PREFIX([
2925          eval additional_includedir=\"$includedir\"
2926          eval additional_libdir=\"$libdir\"
2927        ])
2928      else
2929        additional_includedir="$withval/include"
2930        additional_libdir="$withval/$acl_libdirstem"
2931      fi
2932    fi
2933])
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
2942      haveit=
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
2946          haveit=yes
2947          break
2948        fi
2949      done
2950      if test -z "$haveit"; then
2951        if test "X$additional_includedir" = "X/usr/local/include"; then
2952          if test -n "$GCC"; then
2953            case $host_os in
2954              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2955            esac
2956          fi
2957        fi
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"
2962          fi
2963        fi
2964      fi
2965    fi
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
2973      haveit=
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
2977          haveit=yes
2978          break
2979        fi
2980      done
2981      if test -z "$haveit"; then
2982        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2983          if test -n "$GCC"; then
2984            case $host_os in
2985              linux*) haveit=yes;;
2986            esac
2987          fi
2988        fi
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"
2993          fi
2994        fi
2995      fi
2996    fi
2997  fi
2998])
2999
3000dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
3001dnl acl_final_exec_prefix, containing the values to which $prefix and
3002dnl $exec_prefix will expand at the end of the configure script.
3003AC_DEFUN([AC_LIB_PREPARE_PREFIX],
3004[
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"
3009  else
3010    acl_final_prefix="$prefix"
3011  fi
3012  if test "X$exec_prefix" = "XNONE"; then
3013    acl_final_exec_prefix='${prefix}'
3014  else
3015    acl_final_exec_prefix="$exec_prefix"
3016  fi
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"
3021])
3022
3023dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
3024dnl variables prefix and exec_prefix bound to the values they will have
3025dnl at the end of the configure script.
3026AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
3027[
3028  acl_save_prefix="$prefix"
3029  prefix="$acl_final_prefix"
3030  acl_save_exec_prefix="$exec_prefix"
3031  exec_prefix="$acl_final_exec_prefix"
3032  $1
3033  exec_prefix="$acl_save_exec_prefix"
3034  prefix="$acl_save_prefix"
3035])
3036
3037dnl AC_LIB_PREPARE_MULTILIB creates
3038dnl - a function acl_is_expected_elfclass, that tests whether standard input
3039dn;   has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
3040dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
3041dnl   the basename of the libdir to try in turn, either "lib" or "lib64" or
3042dnl   "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
3043AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
3044[
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,
3055  dnl namely "lib".
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])
3062
3063  AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
3064    [AC_EGREP_CPP([Extensible Linking Format],
3065       [#ifdef __ELF__
3066        Extensible Linking Format
3067        #endif
3068       ],
3069       [gl_cv_elf=yes],
3070       [gl_cv_elf=no])
3071     ])
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
3076      # Use POSIX od.
3077      func_elfclass ()
3078      {
3079        od -A n -t d1 -j 4 -N 1
3080      }
3081    else
3082      # Use BSD hexdump.
3083      func_elfclass ()
3084      {
3085        dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
3086        echo
3087      }
3088    fi
3089changequote(,)dnl
3090    case $HOST_CPU_C_ABI_32BIT in
3091      yes)
3092        # 32-bit ABI.
3093        acl_is_expected_elfclass ()
3094        {
3095          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 1
3096        }
3097        ;;
3098      no)
3099        # 64-bit ABI.
3100        acl_is_expected_elfclass ()
3101        {
3102          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 2
3103        }
3104        ;;
3105      *)
3106        # Unknown.
3107        acl_is_expected_elfclass ()
3108        {
3109          :
3110        }
3111        ;;
3112    esac
3113changequote([,])dnl
3114  else
3115    acl_is_expected_elfclass ()
3116    {
3117      :
3118    }
3119  fi
3120
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>.
3126     acl_libdirstem=lib
3127     acl_libdirstem2=
3128     acl_libdirstem3=
3129     case "$host_os" in
3130       solaris*)
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
3138           case "$host_cpu" in
3139             sparc*)        acl_libdirstem3=lib/sparcv9 ;;
3140             i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
3141           esac
3142         fi
3143         ;;
3144       *)
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
3159           fi
3160         fi
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
3165           fi
3166         fi
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 ;;
3174                 */../ | */.. )
3175                   # Better ignore directories of this form. They are misleading.
3176                   ;;
3177                 *) searchdir=`cd "$searchdir" && pwd`
3178                    case "$searchdir" in
3179                      */lib32 ) acl_libdirstem2=lib32 ;;
3180                      */lib64 ) acl_libdirstem3=lib64 ;;
3181                    esac ;;
3182               esac
3183             fi
3184           done
3185           IFS="$acl_save_IFS"
3186           if test $HOST_CPU_C_ABI_32BIT = yes; then
3187             # 32-bit ABI.
3188             acl_libdirstem3=
3189           fi
3190           if test $HOST_CPU_C_ABI_32BIT = no; then
3191             # 64-bit ABI.
3192             acl_libdirstem2=
3193           fi
3194         fi
3195         ;;
3196     esac
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"
3200    ])
3201  dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
3202  dnl acl_libdirstem3.
3203changequote(,)dnl
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/,.*//'`
3207changequote([,])dnl
3208])
3209
3210# nls.m4 serial 6 (gettext-0.20.2)
3211dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free
3212dnl Software Foundation, Inc.
3213dnl This file is free software; the Free Software Foundation
3214dnl gives unlimited permission to copy and/or distribute it,
3215dnl with or without modifications, as long as this notice is preserved.
3216dnl
3217dnl This file can be used in projects which are not available under
3218dnl the GNU General Public License or the GNU Lesser General Public
3219dnl License but which still want to provide support for the GNU gettext
3220dnl functionality.
3221dnl Please note that the actual code of the GNU gettext library is covered
3222dnl by the GNU Lesser General Public License, and the rest of the GNU
3223dnl gettext package is covered by the GNU General Public License.
3224dnl They are *not* in the public domain.
3225
3226dnl Authors:
3227dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3228dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3229
3230AC_PREREQ([2.50])
3231
3232AC_DEFUN([AM_NLS],
3233[
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])
3240  AC_SUBST([USE_NLS])
3241])
3242
3243# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
3244# serial 12 (pkg-config-0.29.2)
3245
3246dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
3247dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
3248dnl
3249dnl This program is free software; you can redistribute it and/or modify
3250dnl it under the terms of the GNU General Public License as published by
3251dnl the Free Software Foundation; either version 2 of the License, or
3252dnl (at your option) any later version.
3253dnl
3254dnl This program is distributed in the hope that it will be useful, but
3255dnl WITHOUT ANY WARRANTY; without even the implied warranty of
3256dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3257dnl General Public License for more details.
3258dnl
3259dnl You should have received a copy of the GNU General Public License
3260dnl along with this program; if not, write to the Free Software
3261dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3262dnl 02111-1307, USA.
3263dnl
3264dnl As a special exception to the GNU General Public License, if you
3265dnl distribute this file as part of a program that contains a
3266dnl configuration script generated by Autoconf, you may include it under
3267dnl the same distribution terms that you use for the rest of that
3268dnl program.
3269
3270dnl PKG_PREREQ(MIN-VERSION)
3271dnl -----------------------
3272dnl Since: 0.29
3273dnl
3274dnl Verify that the version of the pkg-config macros are at least
3275dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
3276dnl installed version of pkg-config, this checks the developer's version
3277dnl of pkg.m4 when generating configure.
3278dnl
3279dnl To ensure that this macro is defined, also add:
3280dnl m4_ifndef([PKG_PREREQ],
3281dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
3282dnl
3283dnl See the "Since" comment for each macro you use to see what version
3284dnl of the macros you require.
3285m4_defun([PKG_PREREQ],
3286[m4_define([PKG_MACROS_VERSION], [0.29.2])
3287m4_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])])
3289])dnl PKG_PREREQ
3290
3291dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
3292dnl ----------------------------------
3293dnl Since: 0.16
3294dnl
3295dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
3296dnl first found in the path. Checks that the version of pkg-config found
3297dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
3298dnl used since that's the first version where most current features of
3299dnl pkg-config existed.
3300AC_DEFUN([PKG_PROG_PKG_CONFIG],
3301[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
3302m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
3303m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
3304AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
3305AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
3306AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
3307
3308if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
3309	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
3310fi
3311if 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])
3316	else
3317		AC_MSG_RESULT([no])
3318		PKG_CONFIG=""
3319	fi
3320fi[]dnl
3321])dnl PKG_PROG_PKG_CONFIG
3322
3323dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3324dnl -------------------------------------------------------------------
3325dnl Since: 0.18
3326dnl
3327dnl Check to see whether a particular set of modules exists. Similar to
3328dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
3329dnl
3330dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3331dnl only at the first occurence in configure.ac, so if the first place
3332dnl it's called might be skipped (such as if it is within an "if", you
3333dnl have to call PKG_CHECK_EXISTS manually
3334AC_DEFUN([PKG_CHECK_EXISTS],
3335[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3336if test -n "$PKG_CONFIG" && \
3337    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
3338  m4_default([$2], [:])
3339m4_ifvaln([$3], [else
3340  $3])dnl
3341fi])
3342
3343dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
3344dnl ---------------------------------------------
3345dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
3346dnl pkg_failed based on the result.
3347m4_define([_PKG_CONFIG],
3348[if test -n "$$1"; then
3349    pkg_cv_[]$1="$$1"
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 ],
3354		     [pkg_failed=yes])
3355 else
3356    pkg_failed=untried
3357fi[]dnl
3358])dnl _PKG_CONFIG
3359
3360dnl _PKG_SHORT_ERRORS_SUPPORTED
3361dnl ---------------------------
3362dnl Internal check to see if pkg-config supports short errors.
3363AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
3364[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3365if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
3366        _pkg_short_errors_supported=yes
3367else
3368        _pkg_short_errors_supported=no
3369fi[]dnl
3370])dnl _PKG_SHORT_ERRORS_SUPPORTED
3371
3372
3373dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
3374dnl   [ACTION-IF-NOT-FOUND])
3375dnl --------------------------------------------------------------
3376dnl Since: 0.4.0
3377dnl
3378dnl Note that if there is a possibility the first call to
3379dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
3380dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
3381AC_DEFUN([PKG_CHECK_MODULES],
3382[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3383AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
3384AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
3385
3386pkg_failed=no
3387AC_MSG_CHECKING([for $2])
3388
3389_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
3390_PKG_CONFIG([$1][_LIBS], [libs], [$2])
3391
3392m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
3393and $1[]_LIBS to avoid the need to call pkg-config.
3394See the pkg-config man page for more details.])
3395
3396if test $pkg_failed = yes; then
3397        AC_MSG_RESULT([no])
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`
3401        else
3402	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
3403        fi
3404	# Put the nasty error message in config.log where it belongs
3405	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
3406
3407	m4_default([$4], [AC_MSG_ERROR(
3408[Package requirements ($2) were not met:
3409
3410$$1_PKG_ERRORS
3411
3412Consider adjusting the PKG_CONFIG_PATH environment variable if you
3413installed software in a non-standard prefix.
3414
3415_PKG_TEXT])[]dnl
3416        ])
3417elif test $pkg_failed = untried; then
3418        AC_MSG_RESULT([no])
3419	m4_default([$4], [AC_MSG_FAILURE(
3420[The pkg-config script could not be found or is too old.  Make sure it
3421is in your PATH or set the PKG_CONFIG environment variable to the full
3422path to pkg-config.
3423
3424_PKG_TEXT
3425
3426To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
3427        ])
3428else
3429	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
3430	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
3431        AC_MSG_RESULT([yes])
3432	$3
3433fi[]dnl
3434])dnl PKG_CHECK_MODULES
3435
3436
3437dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
3438dnl   [ACTION-IF-NOT-FOUND])
3439dnl ---------------------------------------------------------------------
3440dnl Since: 0.29
3441dnl
3442dnl Checks for existence of MODULES and gathers its build flags with
3443dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
3444dnl and VARIABLE-PREFIX_LIBS from --libs.
3445dnl
3446dnl Note that if there is a possibility the first call to
3447dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
3448dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
3449dnl configure.ac.
3450AC_DEFUN([PKG_CHECK_MODULES_STATIC],
3451[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3452_save_PKG_CONFIG=$PKG_CONFIG
3453PKG_CONFIG="$PKG_CONFIG --static"
3454PKG_CHECK_MODULES($@)
3455PKG_CONFIG=$_save_PKG_CONFIG[]dnl
3456])dnl PKG_CHECK_MODULES_STATIC
3457
3458
3459dnl PKG_INSTALLDIR([DIRECTORY])
3460dnl -------------------------
3461dnl Since: 0.27
3462dnl
3463dnl Substitutes the variable pkgconfigdir as the location where a module
3464dnl should install pkg-config .pc files. By default the directory is
3465dnl $libdir/pkgconfig, but the default can be changed by passing
3466dnl DIRECTORY. The user can override through the --with-pkgconfigdir
3467dnl parameter.
3468AC_DEFUN([PKG_INSTALLDIR],
3469[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
3470m4_pushdef([pkg_description],
3471    [pkg-config installation directory @<:@]pkg_default[@:>@])
3472AC_ARG_WITH([pkgconfigdir],
3473    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
3474    [with_pkgconfigdir=]pkg_default)
3475AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
3476m4_popdef([pkg_default])
3477m4_popdef([pkg_description])
3478])dnl PKG_INSTALLDIR
3479
3480
3481dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
3482dnl --------------------------------
3483dnl Since: 0.27
3484dnl
3485dnl Substitutes the variable noarch_pkgconfigdir as the location where a
3486dnl module should install arch-independent pkg-config .pc files. By
3487dnl default the directory is $datadir/pkgconfig, but the default can be
3488dnl changed by passing DIRECTORY. The user can override through the
3489dnl --with-noarch-pkgconfigdir parameter.
3490AC_DEFUN([PKG_NOARCH_INSTALLDIR],
3491[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
3492m4_pushdef([pkg_description],
3493    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
3494AC_ARG_WITH([noarch-pkgconfigdir],
3495    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
3496    [with_noarch_pkgconfigdir=]pkg_default)
3497AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
3498m4_popdef([pkg_default])
3499m4_popdef([pkg_description])
3500])dnl PKG_NOARCH_INSTALLDIR
3501
3502
3503dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
3504dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3505dnl -------------------------------------------
3506dnl Since: 0.28
3507dnl
3508dnl Retrieves the value of the pkg-config variable for the given module.
3509AC_DEFUN([PKG_CHECK_VAR],
3510[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3511AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
3512
3513_PKG_CONFIG([$1], [variable="][$3]["], [$2])
3514AS_VAR_COPY([$1], [pkg_cv_][$1])
3515
3516AS_VAR_IF([$1], [""], [$5], [$4])dnl
3517])dnl PKG_CHECK_VAR
3518
3519# po.m4 serial 31 (gettext-0.20.2)
3520dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
3521dnl This file is free software; the Free Software Foundation
3522dnl gives unlimited permission to copy and/or distribute it,
3523dnl with or without modifications, as long as this notice is preserved.
3524dnl
3525dnl This file can be used in projects which are not available under
3526dnl the GNU General Public License or the GNU Lesser General Public
3527dnl License but which still want to provide support for the GNU gettext
3528dnl functionality.
3529dnl Please note that the actual code of the GNU gettext library is covered
3530dnl by the GNU Lesser General Public License, and the rest of the GNU
3531dnl gettext package is covered by the GNU General Public License.
3532dnl They are *not* in the public domain.
3533
3534dnl Authors:
3535dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3536dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3537
3538AC_PREREQ([2.60])
3539
3540dnl Checks for all prerequisites of the po subdirectory.
3541AC_DEFUN([AM_PO_SUBDIRS],
3542[
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
3548
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])
3552
3553  dnl Perform the following tests also if --disable-nls has been given,
3554  dnl because they are needed for "make dist" to work.
3555
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)],
3562    :)
3563  AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
3564
3565  dnl Test whether it is GNU msgfmt >= 0.15.
3566changequote(,)dnl
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 ;;
3570  esac
3571changequote([,])dnl
3572  AC_SUBST([GMSGFMT_015])
3573
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)],
3580    :)
3581  dnl Remove leftover from FreeBSD xgettext call.
3582  rm -f messages.po
3583
3584  dnl Test whether it is GNU xgettext >= 0.15.
3585changequote(,)dnl
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 ;;
3589  esac
3590changequote([,])dnl
3591  AC_SUBST([XGETTEXT_015])
3592
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], :)
3596
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'
3600  else
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'
3604    else
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'
3609    fi
3610  fi
3611  AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
3612
3613  dnl Support for AM_XGETTEXT_OPTION.
3614  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
3615  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
3616
3617  AC_CONFIG_COMMANDS([po-directories], [[
3618    for ac_file in $CONFIG_FILES; do
3619      # Support "outfile[:infile[:infile...]]"
3620      case "$ac_file" in
3621        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3622      esac
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" ;;
3636        esac
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
3648          # parameters.
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"
3653            fi
3654            ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3655            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3656          else
3657            # The set of available languages was given in configure.in.
3658            ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
3659          fi
3660          # Compute POFILES
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)
3666          # Compute GMOFILES
3667          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3668          case "$ac_given_srcdir" in
3669            .) srcdirpre= ;;
3670            *) srcdirpre='$(srcdir)/' ;;
3671          esac
3672          POFILES=
3673          UPDATEPOFILES=
3674          DUMMYPOFILES=
3675          GMOFILES=
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"
3681          done
3682          # CATALOGS depends on both $ac_dir and the user's LINGUAS
3683          # environment variable.
3684          INST_LINGUAS=
3685          if test -n "$ALL_LINGUAS"; then
3686            for presentlang in $ALL_LINGUAS; do
3687              useit=no
3688              if test "%UNSET%" != "$LINGUAS"; then
3689                desiredlanguages="$LINGUAS"
3690              else
3691                desiredlanguages="$ALL_LINGUAS"
3692              fi
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;;
3701                esac
3702              done
3703              if test $useit = yes; then
3704                INST_LINGUAS="$INST_LINGUAS $presentlang"
3705              fi
3706            done
3707          fi
3708          CATALOGS=
3709          if test -n "$INST_LINGUAS"; then
3710            for lang in $INST_LINGUAS; do
3711              CATALOGS="$CATALOGS $lang.gmo"
3712            done
3713          fi
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
3718              case "$f" in
3719                *.orig | *.bak | *~) ;;
3720                *) cat "$f" >> "$ac_dir/Makefile" ;;
3721              esac
3722            fi
3723          done
3724        fi
3725        ;;
3726      esac
3727    done]],
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%}"
3733   ])
3734])
3735
3736dnl Postprocesses a Makefile in a directory containing PO files.
3737AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
3738[
3739  # When this code is run, in config.status, two variables have already been
3740  # set:
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
3743  #   time.
3744
3745changequote(,)dnl
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" ;;
3757  esac
3758
3759  # Find a way to echo strings without interpreting backslash.
3760  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
3761    gt_echo='echo'
3762  else
3763    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
3764      gt_echo='printf %s\n'
3765    else
3766      echo_func () {
3767        cat <<EOT
3768$*
3769EOT
3770      }
3771      gt_echo='echo_func'
3772    fi
3773  fi
3774
3775  # A sed script that extracts the value of VARIABLE from a Makefile.
3776  tab=`printf '\t'`
3777  sed_x_variable='
3778# Test if the hold space is empty.
3779x
3780s/P/P/
3781x
3782ta
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}"' ]*=//
3787  ba
3788}
3789bd
3790:a
3791# Here we are processing a line from the variable definition.
3792# Remove comment, more precisely replace it with a space.
3793s/#.*$/ /
3794# See if the line ends in a backslash.
3795tb
3796:b
3797s/\\$//
3798# Print the line, without the trailing backslash.
3799p
3800tc
3801# There was no trailing backslash. The end of the variable definition is
3802# reached. Clear the hold space.
3803s/^.*$//
3804x
3805bd
3806:c
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.
3809s/^.*$/P/
3810x
3811:d
3812'
3813changequote([,])dnl
3814
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))
3820  POTFILES_DEPS=
3821  for file in $POTFILES; do
3822    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
3823  done
3824  POMAKEFILEDEPS=""
3825
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"
3828  fi
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"
3833  else
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"`
3837  fi
3838  # Compute POFILES
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)
3844  # Compute GMOFILES
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)
3850  # Compute QMFILES
3851  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3852  # Compute MSGFILES
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
3857    .) srcdirpre= ;;
3858    *) srcdirpre='$(srcdir)/' ;;
3859  esac
3860  POFILES=
3861  UPDATEPOFILES=
3862  DUMMYPOFILES=
3863  GMOFILES=
3864  PROPERTIESFILES=
3865  CLASSFILES=
3866  QMFILES=
3867  MSGFILES=
3868  RESOURCESDLLFILES=
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"
3881  done
3882  # CATALOGS depends on both $ac_dir and the user's LINGUAS
3883  # environment variable.
3884  INST_LINGUAS=
3885  if test -n "$ALL_LINGUAS"; then
3886    for presentlang in $ALL_LINGUAS; do
3887      useit=no
3888      if test "%UNSET%" != "$LINGUAS"; then
3889        desiredlanguages="$LINGUAS"
3890      else
3891        desiredlanguages="$ALL_LINGUAS"
3892      fi
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;;
3901        esac
3902      done
3903      if test $useit = yes; then
3904        INST_LINGUAS="$INST_LINGUAS $presentlang"
3905      fi
3906    done
3907  fi
3908  CATALOGS=
3909  JAVACATALOGS=
3910  QTCATALOGS=
3911  TCLCATALOGS=
3912  CSHARPCATALOGS=
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"
3922    done
3923  fi
3924
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"
3926  tab=`printf '\t'`
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; }
3935EOF
3936    done
3937  fi
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; }
3946EOF
3947    done
3948  fi
3949  if test -n "$POMAKEFILEDEPS"; then
3950    cat >> "$ac_file.tmp" <<EOF
3951Makefile: $POMAKEFILEDEPS
3952EOF
3953  fi
3954  mv "$ac_file.tmp" "$ac_file"
3955])
3956
3957dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
3958AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
3959[
3960  XGETTEXT_EXTRA_OPTIONS=
3961])
3962
3963dnl Registers an option to be passed to xgettext in the po subdirectory.
3964AC_DEFUN([AM_XGETTEXT_OPTION],
3965[
3966  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
3967  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
3968])
3969
3970# progtest.m4 serial 8 (gettext-0.20.2)
3971dnl Copyright (C) 1996-2003, 2005, 2008-2020 Free Software Foundation, Inc.
3972dnl This file is free software; the Free Software Foundation
3973dnl gives unlimited permission to copy and/or distribute it,
3974dnl with or without modifications, as long as this notice is preserved.
3975dnl
3976dnl This file can be used in projects which are not available under
3977dnl the GNU General Public License or the GNU Lesser General Public
3978dnl License but which still want to provide support for the GNU gettext
3979dnl functionality.
3980dnl Please note that the actual code of the GNU gettext library is covered
3981dnl by the GNU Lesser General Public License, and the rest of the GNU
3982dnl gettext package is covered by the GNU General Public License.
3983dnl They are *not* in the public domain.
3984
3985dnl Authors:
3986dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
3987
3988AC_PREREQ([2.50])
3989
3990# Search path for a program which passes the given test.
3991
3992dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3993dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3994AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3995[
3996# Prepare PATH_SEPARATOR.
3997# The user is always right.
3998if 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.
4002  PATH_SEPARATOR=:
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=';'
4006       }
4007fi
4008
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.
4011cat >conf$$.file <<_ASEOF
4012#! /bin/sh
4013exit 0
4014_ASEOF
4015chmod +x conf$$.file
4016if test -x conf$$.file >/dev/null 2>&1; then
4017  ac_executable_p="test -x"
4018else
4019  ac_executable_p="test -f"
4020fi
4021rm -f conf$$.file
4022
4023# Extract the first word of "$2", so it can be a program name with args.
4024set dummy $2; ac_word=[$]2
4025AC_MSG_CHECKING([for $ac_word])
4026AC_CACHE_VAL([ac_cv_path_$1],
4027[case "[$]$1" in
4028  [[\\/]]* | ?:[[\\/]]*)
4029    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
4030    ;;
4031  *)
4032    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
4033    for ac_dir in ifelse([$5], , $PATH, [$5]); do
4034      IFS="$ac_save_IFS"
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
4039          if [$3]; then
4040            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
4041            break 2
4042          fi
4043        fi
4044      done
4045    done
4046    IFS="$ac_save_IFS"
4047dnl If no 4th arg is given, leave the cache variable unset,
4048dnl so AC_PATH_PROGS will keep looking.
4049ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
4050])dnl
4051    ;;
4052esac])dnl
4053$1="$ac_cv_path_$1"
4054if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
4055  AC_MSG_RESULT([$][$1])
4056else
4057  AC_MSG_RESULT([no])
4058fi
4059AC_SUBST([$1])dnl
4060])
4061
4062m4_include([acinclude.m4])
4063