]> sourceware.org Git - systemtap.git/blob - aclocal.m4
PR25107: -v -L options print duplicate probe points
[systemtap.git] / aclocal.m4
1 # generated automatically by aclocal 1.16.1 -*- Autoconf -*-
2
3 # Copyright (C) 1996-2018 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
14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18 [m4_warning([this file was generated for autoconf 2.69.
19 You have another version of autoconf. It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23 # ===========================================================================
24 # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
25 # ===========================================================================
26 #
27 # SYNOPSIS
28 #
29 # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
30 #
31 # DESCRIPTION
32 #
33 # Check whether the given FLAG works with the current language's compiler
34 # or gives an error. (Warnings, however, are ignored)
35 #
36 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
37 # success/failure.
38 #
39 # If EXTRA-FLAGS is defined, it is added to the current language's default
40 # flags (e.g. CFLAGS) when the check is done. The check is thus made with
41 # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
42 # force the compiler to issue an error when a bad flag is given.
43 #
44 # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
45 #
46 # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
47 # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
48 #
49 # LICENSE
50 #
51 # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
52 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
53 #
54 # This program is free software: you can redistribute it and/or modify it
55 # under the terms of the GNU General Public License as published by the
56 # Free Software Foundation, either version 3 of the License, or (at your
57 # option) any later version.
58 #
59 # This program is distributed in the hope that it will be useful, but
60 # WITHOUT ANY WARRANTY; without even the implied warranty of
61 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
62 # Public License for more details.
63 #
64 # You should have received a copy of the GNU General Public License along
65 # with this program. If not, see <https://www.gnu.org/licenses/>.
66 #
67 # As a special exception, the respective Autoconf Macro's copyright owner
68 # gives unlimited permission to copy, distribute and modify the configure
69 # scripts that are the output of Autoconf when processing the Macro. You
70 # need not follow the terms of the GNU General Public License when using
71 # or distributing such scripts, even though portions of the text of the
72 # Macro appear in them. The GNU General Public License (GPL) does govern
73 # all other use of the material that constitutes the Autoconf Macro.
74 #
75 # This special exception to the GPL applies to versions of the Autoconf
76 # Macro released by the Autoconf Archive. When you make and distribute a
77 # modified version of the Autoconf Macro, you may extend this special
78 # exception to the GPL to apply to your modified version as well.
79
80 #serial 5
81
82 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
83 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
84 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
85 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
86 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
87 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
88 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
89 [AS_VAR_SET(CACHEVAR,[yes])],
90 [AS_VAR_SET(CACHEVAR,[no])])
91 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
92 AS_VAR_IF(CACHEVAR,yes,
93 [m4_default([$2], :)],
94 [m4_default([$3], :)])
95 AS_VAR_POPDEF([CACHEVAR])dnl
96 ])dnl AX_CHECK_COMPILE_FLAGS
97
98 # ===========================================================================
99 # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
100 # ===========================================================================
101 #
102 # SYNOPSIS
103 #
104 # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
105 #
106 # DESCRIPTION
107 #
108 # Check for baseline language coverage in the compiler for the specified
109 # version of the C++ standard. If necessary, add switches to CXX and
110 # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
111 # or '14' (for the C++14 standard).
112 #
113 # The second argument, if specified, indicates whether you insist on an
114 # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
115 # -std=c++11). If neither is specified, you get whatever works, with
116 # preference for an extended mode.
117 #
118 # The third argument, if specified 'mandatory' or if left unspecified,
119 # indicates that baseline support for the specified C++ standard is
120 # required and that the macro should error out if no mode with that
121 # support is found. If specified 'optional', then configuration proceeds
122 # regardless, after defining HAVE_CXX${VERSION} if and only if a
123 # supporting mode is found.
124 #
125 # LICENSE
126 #
127 # Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
128 # Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
129 # Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
130 # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
131 # Copyright (c) 2015 Paul Norman <penorman@mac.com>
132 # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
133 # Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
134 #
135 # Copying and distribution of this file, with or without modification, are
136 # permitted in any medium without royalty provided the copyright notice
137 # and this notice are preserved. This file is offered as-is, without any
138 # warranty.
139
140 #serial 7
141
142 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
143 dnl (serial version number 13).
144
145 AX_REQUIRE_DEFINED([AC_MSG_WARN])
146 AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
147 m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
148 [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
149 [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
150 [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
151 m4_if([$2], [], [],
152 [$2], [ext], [],
153 [$2], [noext], [],
154 [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
155 m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
156 [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
157 [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
158 [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
159 AC_LANG_PUSH([C++])dnl
160 ac_success=no
161 AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
162 ax_cv_cxx_compile_cxx$1,
163 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
164 [ax_cv_cxx_compile_cxx$1=yes],
165 [ax_cv_cxx_compile_cxx$1=no])])
166 if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
167 ac_success=yes
168 fi
169
170 m4_if([$2], [noext], [], [dnl
171 if test x$ac_success = xno; then
172 for alternative in ${ax_cxx_compile_alternatives}; do
173 switch="-std=gnu++${alternative}"
174 cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
175 AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
176 $cachevar,
177 [ac_save_CXX="$CXX"
178 CXX="$CXX $switch"
179 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
180 [eval $cachevar=yes],
181 [eval $cachevar=no])
182 CXX="$ac_save_CXX"])
183 if eval test x\$$cachevar = xyes; then
184 CXX="$CXX $switch"
185 if test -n "$CXXCPP" ; then
186 CXXCPP="$CXXCPP $switch"
187 fi
188 ac_success=yes
189 break
190 fi
191 done
192 fi])
193
194 m4_if([$2], [ext], [], [dnl
195 if test x$ac_success = xno; then
196 dnl HP's aCC needs +std=c++11 according to:
197 dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
198 dnl Cray's crayCC needs "-h std=c++11"
199 for alternative in ${ax_cxx_compile_alternatives}; do
200 for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
201 cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
202 AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
203 $cachevar,
204 [ac_save_CXX="$CXX"
205 CXX="$CXX $switch"
206 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
207 [eval $cachevar=yes],
208 [eval $cachevar=no])
209 CXX="$ac_save_CXX"])
210 if eval test x\$$cachevar = xyes; then
211 CXX="$CXX $switch"
212 if test -n "$CXXCPP" ; then
213 CXXCPP="$CXXCPP $switch"
214 fi
215 ac_success=yes
216 break
217 fi
218 done
219 if test x$ac_success = xyes; then
220 break
221 fi
222 done
223 fi])
224 AC_LANG_POP([C++])
225 if test x$ax_cxx_compile_cxx$1_required = xtrue; then
226 if test x$ac_success = xno; then
227 AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
228 fi
229 fi
230 if test x$ac_success = xno; then
231 HAVE_CXX$1=0
232 AC_MSG_NOTICE([No compiler with C++$1 support was found])
233 else
234 HAVE_CXX$1=1
235 AC_DEFINE(HAVE_CXX$1,1,
236 [define if the compiler supports basic C++$1 syntax])
237 fi
238 AC_SUBST(HAVE_CXX$1)
239 m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])])
240 ])
241
242
243 dnl Test body for checking C++11 support
244
245 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
246 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
247 )
248
249
250 dnl Test body for checking C++14 support
251
252 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
253 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
254 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
255 )
256
257 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
258 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
259 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
260 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
261 )
262
263 dnl Tests for new features in C++11
264
265 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
266
267 // If the compiler admits that it is not ready for C++11, why torture it?
268 // Hopefully, this will speed up the test.
269
270 #ifndef __cplusplus
271
272 #error "This is not a C++ compiler"
273
274 #elif __cplusplus < 201103L
275
276 #error "This is not a C++11 compiler"
277
278 #else
279
280 namespace cxx11
281 {
282
283 namespace test_static_assert
284 {
285
286 template <typename T>
287 struct check
288 {
289 static_assert(sizeof(int) <= sizeof(T), "not big enough");
290 };
291
292 }
293
294 namespace test_final_override
295 {
296
297 struct Base
298 {
299 virtual void f() {}
300 };
301
302 struct Derived : public Base
303 {
304 virtual void f() override {}
305 };
306
307 }
308
309 namespace test_double_right_angle_brackets
310 {
311
312 template < typename T >
313 struct check {};
314
315 typedef check<void> single_type;
316 typedef check<check<void>> double_type;
317 typedef check<check<check<void>>> triple_type;
318 typedef check<check<check<check<void>>>> quadruple_type;
319
320 }
321
322 namespace test_decltype
323 {
324
325 int
326 f()
327 {
328 int a = 1;
329 decltype(a) b = 2;
330 return a + b;
331 }
332
333 }
334
335 namespace test_type_deduction
336 {
337
338 template < typename T1, typename T2 >
339 struct is_same
340 {
341 static const bool value = false;
342 };
343
344 template < typename T >
345 struct is_same<T, T>
346 {
347 static const bool value = true;
348 };
349
350 template < typename T1, typename T2 >
351 auto
352 add(T1 a1, T2 a2) -> decltype(a1 + a2)
353 {
354 return a1 + a2;
355 }
356
357 int
358 test(const int c, volatile int v)
359 {
360 static_assert(is_same<int, decltype(0)>::value == true, "");
361 static_assert(is_same<int, decltype(c)>::value == false, "");
362 static_assert(is_same<int, decltype(v)>::value == false, "");
363 auto ac = c;
364 auto av = v;
365 auto sumi = ac + av + 'x';
366 auto sumf = ac + av + 1.0;
367 static_assert(is_same<int, decltype(ac)>::value == true, "");
368 static_assert(is_same<int, decltype(av)>::value == true, "");
369 static_assert(is_same<int, decltype(sumi)>::value == true, "");
370 static_assert(is_same<int, decltype(sumf)>::value == false, "");
371 static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
372 return (sumf > 0.0) ? sumi : add(c, v);
373 }
374
375 }
376
377 namespace test_noexcept
378 {
379
380 int f() { return 0; }
381 int g() noexcept { return 0; }
382
383 static_assert(noexcept(f()) == false, "");
384 static_assert(noexcept(g()) == true, "");
385
386 }
387
388 namespace test_constexpr
389 {
390
391 template < typename CharT >
392 unsigned long constexpr
393 strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
394 {
395 return *s ? strlen_c_r(s + 1, acc + 1) : acc;
396 }
397
398 template < typename CharT >
399 unsigned long constexpr
400 strlen_c(const CharT *const s) noexcept
401 {
402 return strlen_c_r(s, 0UL);
403 }
404
405 static_assert(strlen_c("") == 0UL, "");
406 static_assert(strlen_c("1") == 1UL, "");
407 static_assert(strlen_c("example") == 7UL, "");
408 static_assert(strlen_c("another\0example") == 7UL, "");
409
410 }
411
412 namespace test_rvalue_references
413 {
414
415 template < int N >
416 struct answer
417 {
418 static constexpr int value = N;
419 };
420
421 answer<1> f(int&) { return answer<1>(); }
422 answer<2> f(const int&) { return answer<2>(); }
423 answer<3> f(int&&) { return answer<3>(); }
424
425 void
426 test()
427 {
428 int i = 0;
429 const int c = 0;
430 static_assert(decltype(f(i))::value == 1, "");
431 static_assert(decltype(f(c))::value == 2, "");
432 static_assert(decltype(f(0))::value == 3, "");
433 }
434
435 }
436
437 namespace test_uniform_initialization
438 {
439
440 struct test
441 {
442 static const int zero {};
443 static const int one {1};
444 };
445
446 static_assert(test::zero == 0, "");
447 static_assert(test::one == 1, "");
448
449 }
450
451 namespace test_lambdas
452 {
453
454 void
455 test1()
456 {
457 auto lambda1 = [](){};
458 auto lambda2 = lambda1;
459 lambda1();
460 lambda2();
461 }
462
463 int
464 test2()
465 {
466 auto a = [](int i, int j){ return i + j; }(1, 2);
467 auto b = []() -> int { return '0'; }();
468 auto c = [=](){ return a + b; }();
469 auto d = [&](){ return c; }();
470 auto e = [a, &b](int x) mutable {
471 const auto identity = [](int y){ return y; };
472 for (auto i = 0; i < a; ++i)
473 a += b--;
474 return x + identity(a + b);
475 }(0);
476 return a + b + c + d + e;
477 }
478
479 int
480 test3()
481 {
482 const auto nullary = [](){ return 0; };
483 const auto unary = [](int x){ return x; };
484 using nullary_t = decltype(nullary);
485 using unary_t = decltype(unary);
486 const auto higher1st = [](nullary_t f){ return f(); };
487 const auto higher2nd = [unary](nullary_t f1){
488 return [unary, f1](unary_t f2){ return f2(unary(f1())); };
489 };
490 return higher1st(nullary) + higher2nd(nullary)(unary);
491 }
492
493 }
494
495 namespace test_variadic_templates
496 {
497
498 template <int...>
499 struct sum;
500
501 template <int N0, int... N1toN>
502 struct sum<N0, N1toN...>
503 {
504 static constexpr auto value = N0 + sum<N1toN...>::value;
505 };
506
507 template <>
508 struct sum<>
509 {
510 static constexpr auto value = 0;
511 };
512
513 static_assert(sum<>::value == 0, "");
514 static_assert(sum<1>::value == 1, "");
515 static_assert(sum<23>::value == 23, "");
516 static_assert(sum<1, 2>::value == 3, "");
517 static_assert(sum<5, 5, 11>::value == 21, "");
518 static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
519
520 }
521
522 // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
523 // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
524 // because of this.
525 namespace test_template_alias_sfinae
526 {
527
528 struct foo {};
529
530 template<typename T>
531 using member = typename T::member_type;
532
533 template<typename T>
534 void func(...) {}
535
536 template<typename T>
537 void func(member<T>*) {}
538
539 void test();
540
541 void test() { func<foo>(0); }
542
543 }
544
545 } // namespace cxx11
546
547 #endif // __cplusplus >= 201103L
548
549 ]])
550
551
552 dnl Tests for new features in C++14
553
554 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
555
556 // If the compiler admits that it is not ready for C++14, why torture it?
557 // Hopefully, this will speed up the test.
558
559 #ifndef __cplusplus
560
561 #error "This is not a C++ compiler"
562
563 #elif __cplusplus < 201402L
564
565 #error "This is not a C++14 compiler"
566
567 #else
568
569 namespace cxx14
570 {
571
572 namespace test_polymorphic_lambdas
573 {
574
575 int
576 test()
577 {
578 const auto lambda = [](auto&&... args){
579 const auto istiny = [](auto x){
580 return (sizeof(x) == 1UL) ? 1 : 0;
581 };
582 const int aretiny[] = { istiny(args)... };
583 return aretiny[0];
584 };
585 return lambda(1, 1L, 1.0f, '1');
586 }
587
588 }
589
590 namespace test_binary_literals
591 {
592
593 constexpr auto ivii = 0b0000000000101010;
594 static_assert(ivii == 42, "wrong value");
595
596 }
597
598 namespace test_generalized_constexpr
599 {
600
601 template < typename CharT >
602 constexpr unsigned long
603 strlen_c(const CharT *const s) noexcept
604 {
605 auto length = 0UL;
606 for (auto p = s; *p; ++p)
607 ++length;
608 return length;
609 }
610
611 static_assert(strlen_c("") == 0UL, "");
612 static_assert(strlen_c("x") == 1UL, "");
613 static_assert(strlen_c("test") == 4UL, "");
614 static_assert(strlen_c("another\0test") == 7UL, "");
615
616 }
617
618 namespace test_lambda_init_capture
619 {
620
621 int
622 test()
623 {
624 auto x = 0;
625 const auto lambda1 = [a = x](int b){ return a + b; };
626 const auto lambda2 = [a = lambda1(x)](){ return a; };
627 return lambda2();
628 }
629
630 }
631
632 namespace test_digit_separators
633 {
634
635 constexpr auto ten_million = 100'000'000;
636 static_assert(ten_million == 100000000, "");
637
638 }
639
640 namespace test_return_type_deduction
641 {
642
643 auto f(int& x) { return x; }
644 decltype(auto) g(int& x) { return x; }
645
646 template < typename T1, typename T2 >
647 struct is_same
648 {
649 static constexpr auto value = false;
650 };
651
652 template < typename T >
653 struct is_same<T, T>
654 {
655 static constexpr auto value = true;
656 };
657
658 int
659 test()
660 {
661 auto x = 0;
662 static_assert(is_same<int, decltype(f(x))>::value, "");
663 static_assert(is_same<int&, decltype(g(x))>::value, "");
664 return x;
665 }
666
667 }
668
669 } // namespace cxx14
670
671 #endif // __cplusplus >= 201402L
672
673 ]])
674
675
676 dnl Tests for new features in C++17
677
678 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
679
680 // If the compiler admits that it is not ready for C++17, why torture it?
681 // Hopefully, this will speed up the test.
682
683 #ifndef __cplusplus
684
685 #error "This is not a C++ compiler"
686
687 #elif __cplusplus <= 201402L
688
689 #error "This is not a C++17 compiler"
690
691 #else
692
693 #if defined(__clang__)
694 #define REALLY_CLANG
695 #else
696 #if defined(__GNUC__)
697 #define REALLY_GCC
698 #endif
699 #endif
700
701 #include <initializer_list>
702 #include <utility>
703 #include <type_traits>
704
705 namespace cxx17
706 {
707
708 #if !defined(REALLY_CLANG)
709 namespace test_constexpr_lambdas
710 {
711
712 // TODO: test it with clang++ from git
713
714 constexpr int foo = [](){return 42;}();
715
716 }
717 #endif // !defined(REALLY_CLANG)
718
719 namespace test::nested_namespace::definitions
720 {
721
722 }
723
724 namespace test_fold_expression
725 {
726
727 template<typename... Args>
728 int multiply(Args... args)
729 {
730 return (args * ... * 1);
731 }
732
733 template<typename... Args>
734 bool all(Args... args)
735 {
736 return (args && ...);
737 }
738
739 }
740
741 namespace test_extended_static_assert
742 {
743
744 static_assert (true);
745
746 }
747
748 namespace test_auto_brace_init_list
749 {
750
751 auto foo = {5};
752 auto bar {5};
753
754 static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
755 static_assert(std::is_same<int, decltype(bar)>::value);
756 }
757
758 namespace test_typename_in_template_template_parameter
759 {
760
761 template<template<typename> typename X> struct D;
762
763 }
764
765 namespace test_fallthrough_nodiscard_maybe_unused_attributes
766 {
767
768 int f1()
769 {
770 return 42;
771 }
772
773 [[nodiscard]] int f2()
774 {
775 [[maybe_unused]] auto unused = f1();
776
777 switch (f1())
778 {
779 case 17:
780 f1();
781 [[fallthrough]];
782 case 42:
783 f1();
784 }
785 return f1();
786 }
787
788 }
789
790 namespace test_extended_aggregate_initialization
791 {
792
793 struct base1
794 {
795 int b1, b2 = 42;
796 };
797
798 struct base2
799 {
800 base2() {
801 b3 = 42;
802 }
803 int b3;
804 };
805
806 struct derived : base1, base2
807 {
808 int d;
809 };
810
811 derived d1 {{1, 2}, {}, 4}; // full initialization
812 derived d2 {{}, {}, 4}; // value-initialized bases
813
814 }
815
816 namespace test_general_range_based_for_loop
817 {
818
819 struct iter
820 {
821 int i;
822
823 int& operator* ()
824 {
825 return i;
826 }
827
828 const int& operator* () const
829 {
830 return i;
831 }
832
833 iter& operator++()
834 {
835 ++i;
836 return *this;
837 }
838 };
839
840 struct sentinel
841 {
842 int i;
843 };
844
845 bool operator== (const iter& i, const sentinel& s)
846 {
847 return i.i == s.i;
848 }
849
850 bool operator!= (const iter& i, const sentinel& s)
851 {
852 return !(i == s);
853 }
854
855 struct range
856 {
857 iter begin() const
858 {
859 return {0};
860 }
861
862 sentinel end() const
863 {
864 return {5};
865 }
866 };
867
868 void f()
869 {
870 range r {};
871
872 for (auto i : r)
873 {
874 [[maybe_unused]] auto v = i;
875 }
876 }
877
878 }
879
880 namespace test_lambda_capture_asterisk_this_by_value
881 {
882
883 struct t
884 {
885 int i;
886 int foo()
887 {
888 return [*this]()
889 {
890 return i;
891 }();
892 }
893 };
894
895 }
896
897 namespace test_enum_class_construction
898 {
899
900 enum class byte : unsigned char
901 {};
902
903 byte foo {42};
904
905 }
906
907 namespace test_constexpr_if
908 {
909
910 template <bool cond>
911 int f ()
912 {
913 if constexpr(cond)
914 {
915 return 13;
916 }
917 else
918 {
919 return 42;
920 }
921 }
922
923 }
924
925 namespace test_selection_statement_with_initializer
926 {
927
928 int f()
929 {
930 return 13;
931 }
932
933 int f2()
934 {
935 if (auto i = f(); i > 0)
936 {
937 return 3;
938 }
939
940 switch (auto i = f(); i + 4)
941 {
942 case 17:
943 return 2;
944
945 default:
946 return 1;
947 }
948 }
949
950 }
951
952 #if !defined(REALLY_CLANG)
953 namespace test_template_argument_deduction_for_class_templates
954 {
955
956 // TODO: test it with clang++ from git
957
958 template <typename T1, typename T2>
959 struct pair
960 {
961 pair (T1 p1, T2 p2)
962 : m1 {p1},
963 m2 {p2}
964 {}
965
966 T1 m1;
967 T2 m2;
968 };
969
970 void f()
971 {
972 [[maybe_unused]] auto p = pair{13, 42u};
973 }
974
975 }
976 #endif // !defined(REALLY_CLANG)
977
978 namespace test_non_type_auto_template_parameters
979 {
980
981 template <auto n>
982 struct B
983 {};
984
985 B<5> b1;
986 B<'a'> b2;
987
988 }
989
990 #if !defined(REALLY_CLANG)
991 namespace test_structured_bindings
992 {
993
994 // TODO: test it with clang++ from git
995
996 int arr[2] = { 1, 2 };
997 std::pair<int, int> pr = { 1, 2 };
998
999 auto f1() -> int(&)[2]
1000 {
1001 return arr;
1002 }
1003
1004 auto f2() -> std::pair<int, int>&
1005 {
1006 return pr;
1007 }
1008
1009 struct S
1010 {
1011 int x1 : 2;
1012 volatile double y1;
1013 };
1014
1015 S f3()
1016 {
1017 return {};
1018 }
1019
1020 auto [ x1, y1 ] = f1();
1021 auto& [ xr1, yr1 ] = f1();
1022 auto [ x2, y2 ] = f2();
1023 auto& [ xr2, yr2 ] = f2();
1024 const auto [ x3, y3 ] = f3();
1025
1026 }
1027 #endif // !defined(REALLY_CLANG)
1028
1029 #if !defined(REALLY_CLANG)
1030 namespace test_exception_spec_type_system
1031 {
1032
1033 // TODO: test it with clang++ from git
1034
1035 struct Good {};
1036 struct Bad {};
1037
1038 void g1() noexcept;
1039 void g2();
1040
1041 template<typename T>
1042 Bad
1043 f(T*, T*);
1044
1045 template<typename T1, typename T2>
1046 Good
1047 f(T1*, T2*);
1048
1049 static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
1050
1051 }
1052 #endif // !defined(REALLY_CLANG)
1053
1054 namespace test_inline_variables
1055 {
1056
1057 template<class T> void f(T)
1058 {}
1059
1060 template<class T> inline T g(T)
1061 {
1062 return T{};
1063 }
1064
1065 template<> inline void f<>(int)
1066 {}
1067
1068 template<> int g<>(int)
1069 {
1070 return 5;
1071 }
1072
1073 }
1074
1075 } // namespace cxx17
1076
1077 #endif // __cplusplus <= 201402L
1078
1079 ]])
1080
1081 # gettext.m4 serial 68 (gettext-0.19.8)
1082 dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
1083 dnl This file is free software; the Free Software Foundation
1084 dnl gives unlimited permission to copy and/or distribute it,
1085 dnl with or without modifications, as long as this notice is preserved.
1086 dnl
1087 dnl This file can be used in projects which are not available under
1088 dnl the GNU General Public License or the GNU Library General Public
1089 dnl License but which still want to provide support for the GNU gettext
1090 dnl functionality.
1091 dnl Please note that the actual code of the GNU gettext library is covered
1092 dnl by the GNU Library General Public License, and the rest of the GNU
1093 dnl gettext package is covered by the GNU General Public License.
1094 dnl They are *not* in the public domain.
1095
1096 dnl Authors:
1097 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1098 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
1099
1100 dnl Macro to add for using GNU gettext.
1101
1102 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1103 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1104 dnl default (if it is not specified or empty) is 'no-libtool'.
1105 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1106 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1107 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1108 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1109 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1110 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1111 dnl $(top_builddir)/intl/libintl.a will be created.
1112 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1113 dnl implementations (in libc or libintl) without the ngettext() function
1114 dnl will be ignored. If NEEDSYMBOL is specified and is
1115 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
1116 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1117 dnl INTLDIR is used to find the intl libraries. If empty,
1118 dnl the value '$(top_builddir)/intl/' is used.
1119 dnl
1120 dnl The result of the configuration is one of three cases:
1121 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1122 dnl and used.
1123 dnl Catalog format: GNU --> install in $(datadir)
1124 dnl Catalog extension: .mo after installation, .gmo in source tree
1125 dnl 2) GNU gettext has been found in the system's C library.
1126 dnl Catalog format: GNU --> install in $(datadir)
1127 dnl Catalog extension: .mo after installation, .gmo in source tree
1128 dnl 3) No internationalization, always use English msgid.
1129 dnl Catalog format: none
1130 dnl Catalog extension: none
1131 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1132 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1133 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1134 dnl but we keep it in order not to force irrelevant filename changes on the
1135 dnl maintainers.
1136 dnl
1137 AC_DEFUN([AM_GNU_GETTEXT],
1138 [
1139 dnl Argument checking.
1140 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1141 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1142 ])])])])])
1143 ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
1144 [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
1145 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1146 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1147 ])])])])
1148 define([gt_included_intl],
1149 ifelse([$1], [external],
1150 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
1151 [yes]))
1152 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
1153 gt_NEEDS_INIT
1154 AM_GNU_GETTEXT_NEED([$2])
1155
1156 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1157 ifelse(gt_included_intl, yes, [
1158 AC_REQUIRE([AM_INTL_SUBDIR])dnl
1159 ])
1160
1161 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1162 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1163 AC_REQUIRE([AC_LIB_RPATH])
1164
1165 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1166 dnl Ideally we would do this search only after the
1167 dnl if test "$USE_NLS" = "yes"; then
1168 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
1169 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1170 dnl the configure script would need to contain the same shell code
1171 dnl again, outside any 'if'. There are two solutions:
1172 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1173 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1174 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1175 dnl documented, we avoid it.
1176 ifelse(gt_included_intl, yes, , [
1177 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1178 ])
1179
1180 dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
1181 gt_INTL_MACOSX
1182
1183 dnl Set USE_NLS.
1184 AC_REQUIRE([AM_NLS])
1185
1186 ifelse(gt_included_intl, yes, [
1187 BUILD_INCLUDED_LIBINTL=no
1188 USE_INCLUDED_LIBINTL=no
1189 ])
1190 LIBINTL=
1191 LTLIBINTL=
1192 POSUB=
1193
1194 dnl Add a version number to the cache macros.
1195 case " $gt_needs " in
1196 *" need-formatstring-macros "*) gt_api_version=3 ;;
1197 *" need-ngettext "*) gt_api_version=2 ;;
1198 *) gt_api_version=1 ;;
1199 esac
1200 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
1201 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
1202
1203 dnl If we use NLS figure out what method
1204 if test "$USE_NLS" = "yes"; then
1205 gt_use_preinstalled_gnugettext=no
1206 ifelse(gt_included_intl, yes, [
1207 AC_MSG_CHECKING([whether included gettext is requested])
1208 AC_ARG_WITH([included-gettext],
1209 [ --with-included-gettext use the GNU gettext library included here],
1210 nls_cv_force_use_gnu_gettext=$withval,
1211 nls_cv_force_use_gnu_gettext=no)
1212 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
1213
1214 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1215 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1216 ])
1217 dnl User does not insist on using GNU NLS library. Figure out what
1218 dnl to use. If GNU gettext is available we use this. Else we have
1219 dnl to fall back to GNU NLS library.
1220
1221 if test $gt_api_version -ge 3; then
1222 gt_revision_test_code='
1223 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1224 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1225 #endif
1226 changequote(,)dnl
1227 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1228 changequote([,])dnl
1229 '
1230 else
1231 gt_revision_test_code=
1232 fi
1233 if test $gt_api_version -ge 2; then
1234 gt_expression_test_code=' + * ngettext ("", "", 0)'
1235 else
1236 gt_expression_test_code=
1237 fi
1238
1239 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
1240 [AC_LINK_IFELSE(
1241 [AC_LANG_PROGRAM(
1242 [[
1243 #include <libintl.h>
1244 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1245 extern int _nl_msg_cat_cntr;
1246 extern int *_nl_domain_bindings;
1247 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
1248 #else
1249 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
1250 #endif
1251 $gt_revision_test_code
1252 ]],
1253 [[
1254 bindtextdomain ("", "");
1255 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
1256 ]])],
1257 [eval "$gt_func_gnugettext_libc=yes"],
1258 [eval "$gt_func_gnugettext_libc=no"])])
1259
1260 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
1261 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1262 ifelse(gt_included_intl, yes, , [
1263 AM_ICONV_LINK
1264 ])
1265 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1266 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1267 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1268 dnl even if libiconv doesn't exist.
1269 AC_LIB_LINKFLAGS_BODY([intl])
1270 AC_CACHE_CHECK([for GNU gettext in libintl],
1271 [$gt_func_gnugettext_libintl],
1272 [gt_save_CPPFLAGS="$CPPFLAGS"
1273 CPPFLAGS="$CPPFLAGS $INCINTL"
1274 gt_save_LIBS="$LIBS"
1275 LIBS="$LIBS $LIBINTL"
1276 dnl Now see whether libintl exists and does not depend on libiconv.
1277 AC_LINK_IFELSE(
1278 [AC_LANG_PROGRAM(
1279 [[
1280 #include <libintl.h>
1281 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1282 extern int _nl_msg_cat_cntr;
1283 extern
1284 #ifdef __cplusplus
1285 "C"
1286 #endif
1287 const char *_nl_expand_alias (const char *);
1288 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
1289 #else
1290 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
1291 #endif
1292 $gt_revision_test_code
1293 ]],
1294 [[
1295 bindtextdomain ("", "");
1296 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
1297 ]])],
1298 [eval "$gt_func_gnugettext_libintl=yes"],
1299 [eval "$gt_func_gnugettext_libintl=no"])
1300 dnl Now see whether libintl exists and depends on libiconv.
1301 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
1302 LIBS="$LIBS $LIBICONV"
1303 AC_LINK_IFELSE(
1304 [AC_LANG_PROGRAM(
1305 [[
1306 #include <libintl.h>
1307 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1308 extern int _nl_msg_cat_cntr;
1309 extern
1310 #ifdef __cplusplus
1311 "C"
1312 #endif
1313 const char *_nl_expand_alias (const char *);
1314 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
1315 #else
1316 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
1317 #endif
1318 $gt_revision_test_code
1319 ]],
1320 [[
1321 bindtextdomain ("", "");
1322 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
1323 ]])],
1324 [LIBINTL="$LIBINTL $LIBICONV"
1325 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1326 eval "$gt_func_gnugettext_libintl=yes"
1327 ])
1328 fi
1329 CPPFLAGS="$gt_save_CPPFLAGS"
1330 LIBS="$gt_save_LIBS"])
1331 fi
1332
1333 dnl If an already present or preinstalled GNU gettext() is found,
1334 dnl use it. But if this macro is used in GNU gettext, and GNU
1335 dnl gettext is already preinstalled in libintl, we update this
1336 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1337 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
1338 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
1339 && test "$PACKAGE" != gettext-runtime \
1340 && test "$PACKAGE" != gettext-tools; }; then
1341 gt_use_preinstalled_gnugettext=yes
1342 else
1343 dnl Reset the values set by searching for libintl.
1344 LIBINTL=
1345 LTLIBINTL=
1346 INCINTL=
1347 fi
1348
1349 ifelse(gt_included_intl, yes, [
1350 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1351 dnl GNU gettext is not found in the C library.
1352 dnl Fall back on included GNU gettext library.
1353 nls_cv_use_gnu_gettext=yes
1354 fi
1355 fi
1356
1357 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1358 dnl Mark actions used to generate GNU NLS library.
1359 BUILD_INCLUDED_LIBINTL=yes
1360 USE_INCLUDED_LIBINTL=yes
1361 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
1362 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
1363 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1364 fi
1365
1366 CATOBJEXT=
1367 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1368 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1369 dnl Mark actions to use GNU gettext tools.
1370 CATOBJEXT=.gmo
1371 fi
1372 ])
1373
1374 if test -n "$INTL_MACOSX_LIBS"; then
1375 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1376 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1377 dnl Some extra flags are needed during linking.
1378 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
1379 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
1380 fi
1381 fi
1382
1383 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1384 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1385 AC_DEFINE([ENABLE_NLS], [1],
1386 [Define to 1 if translation of program messages to the user's native language
1387 is requested.])
1388 else
1389 USE_NLS=no
1390 fi
1391 fi
1392
1393 AC_MSG_CHECKING([whether to use NLS])
1394 AC_MSG_RESULT([$USE_NLS])
1395 if test "$USE_NLS" = "yes"; then
1396 AC_MSG_CHECKING([where the gettext function comes from])
1397 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1398 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
1399 gt_source="external libintl"
1400 else
1401 gt_source="libc"
1402 fi
1403 else
1404 gt_source="included intl directory"
1405 fi
1406 AC_MSG_RESULT([$gt_source])
1407 fi
1408
1409 if test "$USE_NLS" = "yes"; then
1410
1411 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1412 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
1413 AC_MSG_CHECKING([how to link with libintl])
1414 AC_MSG_RESULT([$LIBINTL])
1415 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1416 fi
1417
1418 dnl For backward compatibility. Some packages may be using this.
1419 AC_DEFINE([HAVE_GETTEXT], [1],
1420 [Define if the GNU gettext() function is already present or preinstalled.])
1421 AC_DEFINE([HAVE_DCGETTEXT], [1],
1422 [Define if the GNU dcgettext() function is already present or preinstalled.])
1423 fi
1424
1425 dnl We need to process the po/ directory.
1426 POSUB=po
1427 fi
1428
1429 ifelse(gt_included_intl, yes, [
1430 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1431 dnl to 'yes' because some of the testsuite requires it.
1432 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
1433 BUILD_INCLUDED_LIBINTL=yes
1434 fi
1435
1436 dnl Make all variables we use known to autoconf.
1437 AC_SUBST([BUILD_INCLUDED_LIBINTL])
1438 AC_SUBST([USE_INCLUDED_LIBINTL])
1439 AC_SUBST([CATOBJEXT])
1440
1441 dnl For backward compatibility. Some configure.ins may be using this.
1442 nls_cv_header_intl=
1443 nls_cv_header_libgt=
1444
1445 dnl For backward compatibility. Some Makefiles may be using this.
1446 DATADIRNAME=share
1447 AC_SUBST([DATADIRNAME])
1448
1449 dnl For backward compatibility. Some Makefiles may be using this.
1450 INSTOBJEXT=.mo
1451 AC_SUBST([INSTOBJEXT])
1452
1453 dnl For backward compatibility. Some Makefiles may be using this.
1454 GENCAT=gencat
1455 AC_SUBST([GENCAT])
1456
1457 dnl For backward compatibility. Some Makefiles may be using this.
1458 INTLOBJS=
1459 if test "$USE_INCLUDED_LIBINTL" = yes; then
1460 INTLOBJS="\$(GETTOBJS)"
1461 fi
1462 AC_SUBST([INTLOBJS])
1463
1464 dnl Enable libtool support if the surrounding package wishes it.
1465 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1466 AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
1467 ])
1468
1469 dnl For backward compatibility. Some Makefiles may be using this.
1470 INTLLIBS="$LIBINTL"
1471 AC_SUBST([INTLLIBS])
1472
1473 dnl Make all documented variables known to autoconf.
1474 AC_SUBST([LIBINTL])
1475 AC_SUBST([LTLIBINTL])
1476 AC_SUBST([POSUB])
1477 ])
1478
1479
1480 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
1481 m4_define([gt_NEEDS_INIT],
1482 [
1483 m4_divert_text([DEFAULTS], [gt_needs=])
1484 m4_define([gt_NEEDS_INIT], [])
1485 ])
1486
1487
1488 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
1489 AC_DEFUN([AM_GNU_GETTEXT_NEED],
1490 [
1491 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
1492 ])
1493
1494
1495 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1496 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1497
1498
1499 dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
1500 AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
1501
1502 # iconv.m4 serial 19 (gettext-0.18.2)
1503 dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
1504 dnl This file is free software; the Free Software Foundation
1505 dnl gives unlimited permission to copy and/or distribute it,
1506 dnl with or without modifications, as long as this notice is preserved.
1507
1508 dnl From Bruno Haible.
1509
1510 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1511 [
1512 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1513 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1514 AC_REQUIRE([AC_LIB_RPATH])
1515
1516 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1517 dnl accordingly.
1518 AC_LIB_LINKFLAGS_BODY([iconv])
1519 ])
1520
1521 AC_DEFUN([AM_ICONV_LINK],
1522 [
1523 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1524 dnl those with the standalone portable GNU libiconv installed).
1525 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1526
1527 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1528 dnl accordingly.
1529 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1530
1531 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
1532 dnl because if the user has installed libiconv and not disabled its use
1533 dnl via --without-libiconv-prefix, he wants to use it. The first
1534 dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
1535 am_save_CPPFLAGS="$CPPFLAGS"
1536 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
1537
1538 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
1539 am_cv_func_iconv="no, consider installing GNU libiconv"
1540 am_cv_lib_iconv=no
1541 AC_LINK_IFELSE(
1542 [AC_LANG_PROGRAM(
1543 [[
1544 #include <stdlib.h>
1545 #include <iconv.h>
1546 ]],
1547 [[iconv_t cd = iconv_open("","");
1548 iconv(cd,NULL,NULL,NULL,NULL);
1549 iconv_close(cd);]])],
1550 [am_cv_func_iconv=yes])
1551 if test "$am_cv_func_iconv" != yes; then
1552 am_save_LIBS="$LIBS"
1553 LIBS="$LIBS $LIBICONV"
1554 AC_LINK_IFELSE(
1555 [AC_LANG_PROGRAM(
1556 [[
1557 #include <stdlib.h>
1558 #include <iconv.h>
1559 ]],
1560 [[iconv_t cd = iconv_open("","");
1561 iconv(cd,NULL,NULL,NULL,NULL);
1562 iconv_close(cd);]])],
1563 [am_cv_lib_iconv=yes]
1564 [am_cv_func_iconv=yes])
1565 LIBS="$am_save_LIBS"
1566 fi
1567 ])
1568 if test "$am_cv_func_iconv" = yes; then
1569 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
1570 dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
1571 dnl Solaris 10.
1572 am_save_LIBS="$LIBS"
1573 if test $am_cv_lib_iconv = yes; then
1574 LIBS="$LIBS $LIBICONV"
1575 fi
1576 am_cv_func_iconv_works=no
1577 for ac_iconv_const in '' 'const'; do
1578 AC_RUN_IFELSE(
1579 [AC_LANG_PROGRAM(
1580 [[
1581 #include <iconv.h>
1582 #include <string.h>
1583
1584 #ifndef ICONV_CONST
1585 # define ICONV_CONST $ac_iconv_const
1586 #endif
1587 ]],
1588 [[int result = 0;
1589 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
1590 returns. */
1591 {
1592 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
1593 if (cd_utf8_to_88591 != (iconv_t)(-1))
1594 {
1595 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
1596 char buf[10];
1597 ICONV_CONST char *inptr = input;
1598 size_t inbytesleft = strlen (input);
1599 char *outptr = buf;
1600 size_t outbytesleft = sizeof (buf);
1601 size_t res = iconv (cd_utf8_to_88591,
1602 &inptr, &inbytesleft,
1603 &outptr, &outbytesleft);
1604 if (res == 0)
1605 result |= 1;
1606 iconv_close (cd_utf8_to_88591);
1607 }
1608 }
1609 /* Test against Solaris 10 bug: Failures are not distinguishable from
1610 successful returns. */
1611 {
1612 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
1613 if (cd_ascii_to_88591 != (iconv_t)(-1))
1614 {
1615 static ICONV_CONST char input[] = "\263";
1616 char buf[10];
1617 ICONV_CONST char *inptr = input;
1618 size_t inbytesleft = strlen (input);
1619 char *outptr = buf;
1620 size_t outbytesleft = sizeof (buf);
1621 size_t res = iconv (cd_ascii_to_88591,
1622 &inptr, &inbytesleft,
1623 &outptr, &outbytesleft);
1624 if (res == 0)
1625 result |= 2;
1626 iconv_close (cd_ascii_to_88591);
1627 }
1628 }
1629 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
1630 {
1631 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
1632 if (cd_88591_to_utf8 != (iconv_t)(-1))
1633 {
1634 static ICONV_CONST char input[] = "\304";
1635 static char buf[2] = { (char)0xDE, (char)0xAD };
1636 ICONV_CONST char *inptr = input;
1637 size_t inbytesleft = 1;
1638 char *outptr = buf;
1639 size_t outbytesleft = 1;
1640 size_t res = iconv (cd_88591_to_utf8,
1641 &inptr, &inbytesleft,
1642 &outptr, &outbytesleft);
1643 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
1644 result |= 4;
1645 iconv_close (cd_88591_to_utf8);
1646 }
1647 }
1648 #if 0 /* This bug could be worked around by the caller. */
1649 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
1650 {
1651 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
1652 if (cd_88591_to_utf8 != (iconv_t)(-1))
1653 {
1654 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
1655 char buf[50];
1656 ICONV_CONST char *inptr = input;
1657 size_t inbytesleft = strlen (input);
1658 char *outptr = buf;
1659 size_t outbytesleft = sizeof (buf);
1660 size_t res = iconv (cd_88591_to_utf8,
1661 &inptr, &inbytesleft,
1662 &outptr, &outbytesleft);
1663 if ((int)res > 0)
1664 result |= 8;
1665 iconv_close (cd_88591_to_utf8);
1666 }
1667 }
1668 #endif
1669 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
1670 provided. */
1671 if (/* Try standardized names. */
1672 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
1673 /* Try IRIX, OSF/1 names. */
1674 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
1675 /* Try AIX names. */
1676 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
1677 /* Try HP-UX names. */
1678 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
1679 result |= 16;
1680 return result;
1681 ]])],
1682 [am_cv_func_iconv_works=yes], ,
1683 [case "$host_os" in
1684 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
1685 *) am_cv_func_iconv_works="guessing yes" ;;
1686 esac])
1687 test "$am_cv_func_iconv_works" = no || break
1688 done
1689 LIBS="$am_save_LIBS"
1690 ])
1691 case "$am_cv_func_iconv_works" in
1692 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
1693 *) am_func_iconv=yes ;;
1694 esac
1695 else
1696 am_func_iconv=no am_cv_lib_iconv=no
1697 fi
1698 if test "$am_func_iconv" = yes; then
1699 AC_DEFINE([HAVE_ICONV], [1],
1700 [Define if you have the iconv() function and it works.])
1701 fi
1702 if test "$am_cv_lib_iconv" = yes; then
1703 AC_MSG_CHECKING([how to link with libiconv])
1704 AC_MSG_RESULT([$LIBICONV])
1705 else
1706 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1707 dnl either.
1708 CPPFLAGS="$am_save_CPPFLAGS"
1709 LIBICONV=
1710 LTLIBICONV=
1711 fi
1712 AC_SUBST([LIBICONV])
1713 AC_SUBST([LTLIBICONV])
1714 ])
1715
1716 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
1717 dnl avoid warnings like
1718 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
1719 dnl This is tricky because of the way 'aclocal' is implemented:
1720 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
1721 dnl Otherwise aclocal's initial scan pass would miss the macro definition.
1722 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
1723 dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
1724 dnl warnings.
1725 m4_define([gl_iconv_AC_DEFUN],
1726 m4_version_prereq([2.64],
1727 [[AC_DEFUN_ONCE(
1728 [$1], [$2])]],
1729 [m4_ifdef([gl_00GNULIB],
1730 [[AC_DEFUN_ONCE(
1731 [$1], [$2])]],
1732 [[AC_DEFUN(
1733 [$1], [$2])]])]))
1734 gl_iconv_AC_DEFUN([AM_ICONV],
1735 [
1736 AM_ICONV_LINK
1737 if test "$am_cv_func_iconv" = yes; then
1738 AC_MSG_CHECKING([for iconv declaration])
1739 AC_CACHE_VAL([am_cv_proto_iconv], [
1740 AC_COMPILE_IFELSE(
1741 [AC_LANG_PROGRAM(
1742 [[
1743 #include <stdlib.h>
1744 #include <iconv.h>
1745 extern
1746 #ifdef __cplusplus
1747 "C"
1748 #endif
1749 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
1750 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1751 #else
1752 size_t iconv();
1753 #endif
1754 ]],
1755 [[]])],
1756 [am_cv_proto_iconv_arg1=""],
1757 [am_cv_proto_iconv_arg1="const"])
1758 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);"])
1759 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1760 AC_MSG_RESULT([
1761 $am_cv_proto_iconv])
1762 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
1763 [Define as const if the declaration of iconv() needs const.])
1764 dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
1765 m4_ifdef([gl_ICONV_H_DEFAULTS],
1766 [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
1767 if test -n "$am_cv_proto_iconv_arg1"; then
1768 ICONV_CONST="const"
1769 fi
1770 ])
1771 fi
1772 ])
1773
1774 # intlmacosx.m4 serial 5 (gettext-0.18.2)
1775 dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc.
1776 dnl This file is free software; the Free Software Foundation
1777 dnl gives unlimited permission to copy and/or distribute it,
1778 dnl with or without modifications, as long as this notice is preserved.
1779 dnl
1780 dnl This file can be used in projects which are not available under
1781 dnl the GNU General Public License or the GNU Library General Public
1782 dnl License but which still want to provide support for the GNU gettext
1783 dnl functionality.
1784 dnl Please note that the actual code of the GNU gettext library is covered
1785 dnl by the GNU Library General Public License, and the rest of the GNU
1786 dnl gettext package is covered by the GNU General Public License.
1787 dnl They are *not* in the public domain.
1788
1789 dnl Checks for special options needed on Mac OS X.
1790 dnl Defines INTL_MACOSX_LIBS.
1791 AC_DEFUN([gt_INTL_MACOSX],
1792 [
1793 dnl Check for API introduced in Mac OS X 10.2.
1794 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1795 [gt_cv_func_CFPreferencesCopyAppValue],
1796 [gt_save_LIBS="$LIBS"
1797 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1798 AC_LINK_IFELSE(
1799 [AC_LANG_PROGRAM(
1800 [[#include <CoreFoundation/CFPreferences.h>]],
1801 [[CFPreferencesCopyAppValue(NULL, NULL)]])],
1802 [gt_cv_func_CFPreferencesCopyAppValue=yes],
1803 [gt_cv_func_CFPreferencesCopyAppValue=no])
1804 LIBS="$gt_save_LIBS"])
1805 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1806 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
1807 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1808 fi
1809 dnl Check for API introduced in Mac OS X 10.3.
1810 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
1811 [gt_save_LIBS="$LIBS"
1812 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1813 AC_LINK_IFELSE(
1814 [AC_LANG_PROGRAM(
1815 [[#include <CoreFoundation/CFLocale.h>]],
1816 [[CFLocaleCopyCurrent();]])],
1817 [gt_cv_func_CFLocaleCopyCurrent=yes],
1818 [gt_cv_func_CFLocaleCopyCurrent=no])
1819 LIBS="$gt_save_LIBS"])
1820 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1821 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
1822 [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
1823 fi
1824 INTL_MACOSX_LIBS=
1825 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1826 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1827 fi
1828 AC_SUBST([INTL_MACOSX_LIBS])
1829 ])
1830
1831 # lib-ld.m4 serial 6
1832 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
1833 dnl This file is free software; the Free Software Foundation
1834 dnl gives unlimited permission to copy and/or distribute it,
1835 dnl with or without modifications, as long as this notice is preserved.
1836
1837 dnl Subroutines of libtool.m4,
1838 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
1839 dnl collision with libtool.m4.
1840
1841 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
1842 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1843 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
1844 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
1845 case `$LD -v 2>&1 </dev/null` in
1846 *GNU* | *'with BFD'*)
1847 acl_cv_prog_gnu_ld=yes
1848 ;;
1849 *)
1850 acl_cv_prog_gnu_ld=no
1851 ;;
1852 esac])
1853 with_gnu_ld=$acl_cv_prog_gnu_ld
1854 ])
1855
1856 dnl From libtool-2.4. Sets the variable LD.
1857 AC_DEFUN([AC_LIB_PROG_LD],
1858 [AC_REQUIRE([AC_PROG_CC])dnl
1859 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1860
1861 AC_ARG_WITH([gnu-ld],
1862 [AS_HELP_STRING([--with-gnu-ld],
1863 [assume the C compiler uses GNU ld [default=no]])],
1864 [test "$withval" = no || with_gnu_ld=yes],
1865 [with_gnu_ld=no])dnl
1866
1867 # Prepare PATH_SEPARATOR.
1868 # The user is always right.
1869 if test "${PATH_SEPARATOR+set}" != set; then
1870 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
1871 # contains only /bin. Note that ksh looks also at the FPATH variable,
1872 # so we have to set that as well for the test.
1873 PATH_SEPARATOR=:
1874 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1875 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1876 || PATH_SEPARATOR=';'
1877 }
1878 fi
1879
1880 ac_prog=ld
1881 if test "$GCC" = yes; then
1882 # Check if gcc -print-prog-name=ld gives a path.
1883 AC_MSG_CHECKING([for ld used by $CC])
1884 case $host in
1885 *-*-mingw*)
1886 # gcc leaves a trailing carriage return which upsets mingw
1887 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1888 *)
1889 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1890 esac
1891 case $ac_prog in
1892 # Accept absolute paths.
1893 [[\\/]]* | ?:[[\\/]]*)
1894 re_direlt='/[[^/]][[^/]]*/\.\./'
1895 # Canonicalize the pathname of ld
1896 ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
1897 while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
1898 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1899 done
1900 test -z "$LD" && LD="$ac_prog"
1901 ;;
1902 "")
1903 # If it fails, then pretend we aren't using GCC.
1904 ac_prog=ld
1905 ;;
1906 *)
1907 # If it is relative, then search for the first ld in PATH.
1908 with_gnu_ld=unknown
1909 ;;
1910 esac
1911 elif test "$with_gnu_ld" = yes; then
1912 AC_MSG_CHECKING([for GNU ld])
1913 else
1914 AC_MSG_CHECKING([for non-GNU ld])
1915 fi
1916 AC_CACHE_VAL([acl_cv_path_LD],
1917 [if test -z "$LD"; then
1918 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1919 for ac_dir in $PATH; do
1920 IFS="$acl_save_ifs"
1921 test -z "$ac_dir" && ac_dir=.
1922 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1923 acl_cv_path_LD="$ac_dir/$ac_prog"
1924 # Check to see if the program is GNU ld. I'd rather use --version,
1925 # but apparently some variants of GNU ld only accept -v.
1926 # Break only if it was the GNU/non-GNU ld that we prefer.
1927 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
1928 *GNU* | *'with BFD'*)
1929 test "$with_gnu_ld" != no && break
1930 ;;
1931 *)
1932 test "$with_gnu_ld" != yes && break
1933 ;;
1934 esac
1935 fi
1936 done
1937 IFS="$acl_save_ifs"
1938 else
1939 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1940 fi])
1941 LD="$acl_cv_path_LD"
1942 if test -n "$LD"; then
1943 AC_MSG_RESULT([$LD])
1944 else
1945 AC_MSG_RESULT([no])
1946 fi
1947 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1948 AC_LIB_PROG_LD_GNU
1949 ])
1950
1951 # lib-link.m4 serial 26 (gettext-0.18.2)
1952 dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
1953 dnl This file is free software; the Free Software Foundation
1954 dnl gives unlimited permission to copy and/or distribute it,
1955 dnl with or without modifications, as long as this notice is preserved.
1956
1957 dnl From Bruno Haible.
1958
1959 AC_PREREQ([2.54])
1960
1961 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1962 dnl the libraries corresponding to explicit and implicit dependencies.
1963 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1964 dnl augments the CPPFLAGS variable.
1965 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1966 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1967 AC_DEFUN([AC_LIB_LINKFLAGS],
1968 [
1969 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1970 AC_REQUIRE([AC_LIB_RPATH])
1971 pushdef([Name],[m4_translit([$1],[./+-], [____])])
1972 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1973 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1974 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1975 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1976 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1977 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1978 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1979 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1980 ])
1981 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1982 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1983 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1984 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1985 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1986 AC_SUBST([LIB]NAME)
1987 AC_SUBST([LTLIB]NAME)
1988 AC_SUBST([LIB]NAME[_PREFIX])
1989 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1990 dnl results of this search when this library appears as a dependency.
1991 HAVE_LIB[]NAME=yes
1992 popdef([NAME])
1993 popdef([Name])
1994 ])
1995
1996 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
1997 dnl searches for libname and the libraries corresponding to explicit and
1998 dnl implicit dependencies, together with the specified include files and
1999 dnl the ability to compile and link the specified testcode. The missing-message
2000 dnl defaults to 'no' and may contain additional hints for the user.
2001 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
2002 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2003 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2004 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2005 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
2006 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2007 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2008 [
2009 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2010 AC_REQUIRE([AC_LIB_RPATH])
2011 pushdef([Name],[m4_translit([$1],[./+-], [____])])
2012 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2013 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2014
2015 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2016 dnl accordingly.
2017 AC_LIB_LINKFLAGS_BODY([$1], [$2])
2018
2019 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2020 dnl because if the user has installed lib[]Name and not disabled its use
2021 dnl via --without-lib[]Name-prefix, he wants to use it.
2022 ac_save_CPPFLAGS="$CPPFLAGS"
2023 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2024
2025 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2026 ac_save_LIBS="$LIBS"
2027 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
2028 dnl because these -l options might require -L options that are present in
2029 dnl LIBS. -l options benefit only from the -L options listed before it.
2030 dnl Otherwise, add it to the front of LIBS, because it may be a static
2031 dnl library that depends on another static library that is present in LIBS.
2032 dnl Static libraries benefit only from the static libraries listed after
2033 dnl it.
2034 case " $LIB[]NAME" in
2035 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
2036 *) LIBS="$LIB[]NAME $LIBS" ;;
2037 esac
2038 AC_LINK_IFELSE(
2039 [AC_LANG_PROGRAM([[$3]], [[$4]])],
2040 [ac_cv_lib[]Name=yes],
2041 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
2042 LIBS="$ac_save_LIBS"
2043 ])
2044 if test "$ac_cv_lib[]Name" = yes; then
2045 HAVE_LIB[]NAME=yes
2046 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
2047 AC_MSG_CHECKING([how to link with lib[]$1])
2048 AC_MSG_RESULT([$LIB[]NAME])
2049 else
2050 HAVE_LIB[]NAME=no
2051 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2052 dnl $INC[]NAME either.
2053 CPPFLAGS="$ac_save_CPPFLAGS"
2054 LIB[]NAME=
2055 LTLIB[]NAME=
2056 LIB[]NAME[]_PREFIX=
2057 fi
2058 AC_SUBST([HAVE_LIB]NAME)
2059 AC_SUBST([LIB]NAME)
2060 AC_SUBST([LTLIB]NAME)
2061 AC_SUBST([LIB]NAME[_PREFIX])
2062 popdef([NAME])
2063 popdef([Name])
2064 ])
2065
2066 dnl Determine the platform dependent parameters needed to use rpath:
2067 dnl acl_libext,
2068 dnl acl_shlibext,
2069 dnl acl_libname_spec,
2070 dnl acl_library_names_spec,
2071 dnl acl_hardcode_libdir_flag_spec,
2072 dnl acl_hardcode_libdir_separator,
2073 dnl acl_hardcode_direct,
2074 dnl acl_hardcode_minus_L.
2075 AC_DEFUN([AC_LIB_RPATH],
2076 [
2077 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
2078 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
2079 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
2080 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
2081 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
2082 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
2083 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
2084 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
2085 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
2086 . ./conftest.sh
2087 rm -f ./conftest.sh
2088 acl_cv_rpath=done
2089 ])
2090 wl="$acl_cv_wl"
2091 acl_libext="$acl_cv_libext"
2092 acl_shlibext="$acl_cv_shlibext"
2093 acl_libname_spec="$acl_cv_libname_spec"
2094 acl_library_names_spec="$acl_cv_library_names_spec"
2095 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
2096 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
2097 acl_hardcode_direct="$acl_cv_hardcode_direct"
2098 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
2099 dnl Determine whether the user wants rpath handling at all.
2100 AC_ARG_ENABLE([rpath],
2101 [ --disable-rpath do not hardcode runtime library paths],
2102 :, enable_rpath=yes)
2103 ])
2104
2105 dnl AC_LIB_FROMPACKAGE(name, package)
2106 dnl declares that libname comes from the given package. The configure file
2107 dnl will then not have a --with-libname-prefix option but a
2108 dnl --with-package-prefix option. Several libraries can come from the same
2109 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
2110 dnl macro call that searches for libname.
2111 AC_DEFUN([AC_LIB_FROMPACKAGE],
2112 [
2113 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2114 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2115 define([acl_frompackage_]NAME, [$2])
2116 popdef([NAME])
2117 pushdef([PACK],[$2])
2118 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
2119 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2120 define([acl_libsinpackage_]PACKUP,
2121 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
2122 popdef([PACKUP])
2123 popdef([PACK])
2124 ])
2125
2126 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2127 dnl the libraries corresponding to explicit and implicit dependencies.
2128 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2129 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
2130 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
2131 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2132 [
2133 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2134 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
2135 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2136 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
2137 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
2138 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
2139 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
2140 dnl Autoconf >= 2.61 supports dots in --with options.
2141 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
2142 dnl By default, look in $includedir and $libdir.
2143 use_additional=yes
2144 AC_LIB_WITH_FINAL_PREFIX([
2145 eval additional_includedir=\"$includedir\"
2146 eval additional_libdir=\"$libdir\"
2147 ])
2148 AC_ARG_WITH(P_A_C_K[-prefix],
2149 [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
2150 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
2151 [
2152 if test "X$withval" = "Xno"; then
2153 use_additional=no
2154 else
2155 if test "X$withval" = "X"; then
2156 AC_LIB_WITH_FINAL_PREFIX([
2157 eval additional_includedir=\"$includedir\"
2158 eval additional_libdir=\"$libdir\"
2159 ])
2160 else
2161 additional_includedir="$withval/include"
2162 additional_libdir="$withval/$acl_libdirstem"
2163 if test "$acl_libdirstem2" != "$acl_libdirstem" \
2164 && ! test -d "$withval/$acl_libdirstem"; then
2165 additional_libdir="$withval/$acl_libdirstem2"
2166 fi
2167 fi
2168 fi
2169 ])
2170 dnl Search the library and its dependencies in $additional_libdir and
2171 dnl $LDFLAGS. Using breadth-first-seach.
2172 LIB[]NAME=
2173 LTLIB[]NAME=
2174 INC[]NAME=
2175 LIB[]NAME[]_PREFIX=
2176 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
2177 dnl computed. So it has to be reset here.
2178 HAVE_LIB[]NAME=
2179 rpathdirs=
2180 ltrpathdirs=
2181 names_already_handled=
2182 names_next_round='$1 $2'
2183 while test -n "$names_next_round"; do
2184 names_this_round="$names_next_round"
2185 names_next_round=
2186 for name in $names_this_round; do
2187 already_handled=
2188 for n in $names_already_handled; do
2189 if test "$n" = "$name"; then
2190 already_handled=yes
2191 break
2192 fi
2193 done
2194 if test -z "$already_handled"; then
2195 names_already_handled="$names_already_handled $name"
2196 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2197 dnl or AC_LIB_HAVE_LINKFLAGS call.
2198 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
2199 eval value=\"\$HAVE_LIB$uppername\"
2200 if test -n "$value"; then
2201 if test "$value" = yes; then
2202 eval value=\"\$LIB$uppername\"
2203 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2204 eval value=\"\$LTLIB$uppername\"
2205 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2206 else
2207 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2208 dnl that this library doesn't exist. So just drop it.
2209 :
2210 fi
2211 else
2212 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2213 dnl and the already constructed $LIBNAME/$LTLIBNAME.
2214 found_dir=
2215 found_la=
2216 found_so=
2217 found_a=
2218 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
2219 if test -n "$acl_shlibext"; then
2220 shrext=".$acl_shlibext" # typically: shrext=.so
2221 else
2222 shrext=
2223 fi
2224 if test $use_additional = yes; then
2225 dir="$additional_libdir"
2226 dnl The same code as in the loop below:
2227 dnl First look for a shared library.
2228 if test -n "$acl_shlibext"; then
2229 if test -f "$dir/$libname$shrext"; then
2230 found_dir="$dir"
2231 found_so="$dir/$libname$shrext"
2232 else
2233 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
2234 ver=`(cd "$dir" && \
2235 for f in "$libname$shrext".*; do echo "$f"; done \
2236 | sed -e "s,^$libname$shrext\\\\.,," \
2237 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
2238 | sed 1q ) 2>/dev/null`
2239 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
2240 found_dir="$dir"
2241 found_so="$dir/$libname$shrext.$ver"
2242 fi
2243 else
2244 eval library_names=\"$acl_library_names_spec\"
2245 for f in $library_names; do
2246 if test -f "$dir/$f"; then
2247 found_dir="$dir"
2248 found_so="$dir/$f"
2249 break
2250 fi
2251 done
2252 fi
2253 fi
2254 fi
2255 dnl Then look for a static library.
2256 if test "X$found_dir" = "X"; then
2257 if test -f "$dir/$libname.$acl_libext"; then
2258 found_dir="$dir"
2259 found_a="$dir/$libname.$acl_libext"
2260 fi
2261 fi
2262 if test "X$found_dir" != "X"; then
2263 if test -f "$dir/$libname.la"; then
2264 found_la="$dir/$libname.la"
2265 fi
2266 fi
2267 fi
2268 if test "X$found_dir" = "X"; then
2269 for x in $LDFLAGS $LTLIB[]NAME; do
2270 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2271 case "$x" in
2272 -L*)
2273 dir=`echo "X$x" | sed -e 's/^X-L//'`
2274 dnl First look for a shared library.
2275 if test -n "$acl_shlibext"; then
2276 if test -f "$dir/$libname$shrext"; then
2277 found_dir="$dir"
2278 found_so="$dir/$libname$shrext"
2279 else
2280 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
2281 ver=`(cd "$dir" && \
2282 for f in "$libname$shrext".*; do echo "$f"; done \
2283 | sed -e "s,^$libname$shrext\\\\.,," \
2284 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
2285 | sed 1q ) 2>/dev/null`
2286 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
2287 found_dir="$dir"
2288 found_so="$dir/$libname$shrext.$ver"
2289 fi
2290 else
2291 eval library_names=\"$acl_library_names_spec\"
2292 for f in $library_names; do
2293 if test -f "$dir/$f"; then
2294 found_dir="$dir"
2295 found_so="$dir/$f"
2296 break
2297 fi
2298 done
2299 fi
2300 fi
2301 fi
2302 dnl Then look for a static library.
2303 if test "X$found_dir" = "X"; then
2304 if test -f "$dir/$libname.$acl_libext"; then
2305 found_dir="$dir"
2306 found_a="$dir/$libname.$acl_libext"
2307 fi
2308 fi
2309 if test "X$found_dir" != "X"; then
2310 if test -f "$dir/$libname.la"; then
2311 found_la="$dir/$libname.la"
2312 fi
2313 fi
2314 ;;
2315 esac
2316 if test "X$found_dir" != "X"; then
2317 break
2318 fi
2319 done
2320 fi
2321 if test "X$found_dir" != "X"; then
2322 dnl Found the library.
2323 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2324 if test "X$found_so" != "X"; then
2325 dnl Linking with a shared library. We attempt to hardcode its
2326 dnl directory into the executable's runpath, unless it's the
2327 dnl standard /usr/lib.
2328 if test "$enable_rpath" = no \
2329 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
2330 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
2331 dnl No hardcoding is needed.
2332 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2333 else
2334 dnl Use an explicit option to hardcode DIR into the resulting
2335 dnl binary.
2336 dnl Potentially add DIR to ltrpathdirs.
2337 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2338 haveit=
2339 for x in $ltrpathdirs; do
2340 if test "X$x" = "X$found_dir"; then
2341 haveit=yes
2342 break
2343 fi
2344 done
2345 if test -z "$haveit"; then
2346 ltrpathdirs="$ltrpathdirs $found_dir"
2347 fi
2348 dnl The hardcoding into $LIBNAME is system dependent.
2349 if test "$acl_hardcode_direct" = yes; then
2350 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2351 dnl resulting binary.
2352 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2353 else
2354 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2355 dnl Use an explicit option to hardcode DIR into the resulting
2356 dnl binary.
2357 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2358 dnl Potentially add DIR to rpathdirs.
2359 dnl The rpathdirs will be appended to $LIBNAME at the end.
2360 haveit=
2361 for x in $rpathdirs; do
2362 if test "X$x" = "X$found_dir"; then
2363 haveit=yes
2364 break
2365 fi
2366 done
2367 if test -z "$haveit"; then
2368 rpathdirs="$rpathdirs $found_dir"
2369 fi
2370 else
2371 dnl Rely on "-L$found_dir".
2372 dnl But don't add it if it's already contained in the LDFLAGS
2373 dnl or the already constructed $LIBNAME
2374 haveit=
2375 for x in $LDFLAGS $LIB[]NAME; do
2376 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2377 if test "X$x" = "X-L$found_dir"; then
2378 haveit=yes
2379 break
2380 fi
2381 done
2382 if test -z "$haveit"; then
2383 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2384 fi
2385 if test "$acl_hardcode_minus_L" != no; then
2386 dnl FIXME: Not sure whether we should use
2387 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2388 dnl here.
2389 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2390 else
2391 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
2392 dnl here, because this doesn't fit in flags passed to the
2393 dnl compiler. So give up. No hardcoding. This affects only
2394 dnl very old systems.
2395 dnl FIXME: Not sure whether we should use
2396 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2397 dnl here.
2398 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2399 fi
2400 fi
2401 fi
2402 fi
2403 else
2404 if test "X$found_a" != "X"; then
2405 dnl Linking with a static library.
2406 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2407 else
2408 dnl We shouldn't come here, but anyway it's good to have a
2409 dnl fallback.
2410 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2411 fi
2412 fi
2413 dnl Assume the include files are nearby.
2414 additional_includedir=
2415 case "$found_dir" in
2416 */$acl_libdirstem | */$acl_libdirstem/)
2417 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
2418 if test "$name" = '$1'; then
2419 LIB[]NAME[]_PREFIX="$basedir"
2420 fi
2421 additional_includedir="$basedir/include"
2422 ;;
2423 */$acl_libdirstem2 | */$acl_libdirstem2/)
2424 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
2425 if test "$name" = '$1'; then
2426 LIB[]NAME[]_PREFIX="$basedir"
2427 fi
2428 additional_includedir="$basedir/include"
2429 ;;
2430 esac
2431 if test "X$additional_includedir" != "X"; then
2432 dnl Potentially add $additional_includedir to $INCNAME.
2433 dnl But don't add it
2434 dnl 1. if it's the standard /usr/include,
2435 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2436 dnl 3. if it's already present in $CPPFLAGS or the already
2437 dnl constructed $INCNAME,
2438 dnl 4. if it doesn't exist as a directory.
2439 if test "X$additional_includedir" != "X/usr/include"; then
2440 haveit=
2441 if test "X$additional_includedir" = "X/usr/local/include"; then
2442 if test -n "$GCC"; then
2443 case $host_os in
2444 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2445 esac
2446 fi
2447 fi
2448 if test -z "$haveit"; then
2449 for x in $CPPFLAGS $INC[]NAME; do
2450 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2451 if test "X$x" = "X-I$additional_includedir"; then
2452 haveit=yes
2453 break
2454 fi
2455 done
2456 if test -z "$haveit"; then
2457 if test -d "$additional_includedir"; then
2458 dnl Really add $additional_includedir to $INCNAME.
2459 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2460 fi
2461 fi
2462 fi
2463 fi
2464 fi
2465 dnl Look for dependencies.
2466 if test -n "$found_la"; then
2467 dnl Read the .la file. It defines the variables
2468 dnl dlname, library_names, old_library, dependency_libs, current,
2469 dnl age, revision, installed, dlopen, dlpreopen, libdir.
2470 save_libdir="$libdir"
2471 case "$found_la" in
2472 */* | *\\*) . "$found_la" ;;
2473 *) . "./$found_la" ;;
2474 esac
2475 libdir="$save_libdir"
2476 dnl We use only dependency_libs.
2477 for dep in $dependency_libs; do
2478 case "$dep" in
2479 -L*)
2480 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2481 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2482 dnl But don't add it
2483 dnl 1. if it's the standard /usr/lib,
2484 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2485 dnl 3. if it's already present in $LDFLAGS or the already
2486 dnl constructed $LIBNAME,
2487 dnl 4. if it doesn't exist as a directory.
2488 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
2489 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
2490 haveit=
2491 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
2492 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
2493 if test -n "$GCC"; then
2494 case $host_os in
2495 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2496 esac
2497 fi
2498 fi
2499 if test -z "$haveit"; then
2500 haveit=
2501 for x in $LDFLAGS $LIB[]NAME; do
2502 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2503 if test "X$x" = "X-L$additional_libdir"; then
2504 haveit=yes
2505 break
2506 fi
2507 done
2508 if test -z "$haveit"; then
2509 if test -d "$additional_libdir"; then
2510 dnl Really add $additional_libdir to $LIBNAME.
2511 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2512 fi
2513 fi
2514 haveit=
2515 for x in $LDFLAGS $LTLIB[]NAME; do
2516 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2517 if test "X$x" = "X-L$additional_libdir"; then
2518 haveit=yes
2519 break
2520 fi
2521 done
2522 if test -z "$haveit"; then
2523 if test -d "$additional_libdir"; then
2524 dnl Really add $additional_libdir to $LTLIBNAME.
2525 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2526 fi
2527 fi
2528 fi
2529 fi
2530 ;;
2531 -R*)
2532 dir=`echo "X$dep" | sed -e 's/^X-R//'`
2533 if test "$enable_rpath" != no; then
2534 dnl Potentially add DIR to rpathdirs.
2535 dnl The rpathdirs will be appended to $LIBNAME at the end.
2536 haveit=
2537 for x in $rpathdirs; do
2538 if test "X$x" = "X$dir"; then
2539 haveit=yes
2540 break
2541 fi
2542 done
2543 if test -z "$haveit"; then
2544 rpathdirs="$rpathdirs $dir"
2545 fi
2546 dnl Potentially add DIR to ltrpathdirs.
2547 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2548 haveit=
2549 for x in $ltrpathdirs; do
2550 if test "X$x" = "X$dir"; then
2551 haveit=yes
2552 break
2553 fi
2554 done
2555 if test -z "$haveit"; then
2556 ltrpathdirs="$ltrpathdirs $dir"
2557 fi
2558 fi
2559 ;;
2560 -l*)
2561 dnl Handle this in the next round.
2562 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2563 ;;
2564 *.la)
2565 dnl Handle this in the next round. Throw away the .la's
2566 dnl directory; it is already contained in a preceding -L
2567 dnl option.
2568 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2569 ;;
2570 *)
2571 dnl Most likely an immediate library name.
2572 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2573 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2574 ;;
2575 esac
2576 done
2577 fi
2578 else
2579 dnl Didn't find the library; assume it is in the system directories
2580 dnl known to the linker and runtime loader. (All the system
2581 dnl directories known to the linker should also be known to the
2582 dnl runtime loader, otherwise the system is severely misconfigured.)
2583 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2584 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2585 fi
2586 fi
2587 fi
2588 done
2589 done
2590 if test "X$rpathdirs" != "X"; then
2591 if test -n "$acl_hardcode_libdir_separator"; then
2592 dnl Weird platform: only the last -rpath option counts, the user must
2593 dnl pass all path elements in one option. We can arrange that for a
2594 dnl single library, but not when more than one $LIBNAMEs are used.
2595 alldirs=
2596 for found_dir in $rpathdirs; do
2597 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
2598 done
2599 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
2600 acl_save_libdir="$libdir"
2601 libdir="$alldirs"
2602 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2603 libdir="$acl_save_libdir"
2604 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2605 else
2606 dnl The -rpath options are cumulative.
2607 for found_dir in $rpathdirs; do
2608 acl_save_libdir="$libdir"
2609 libdir="$found_dir"
2610 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2611 libdir="$acl_save_libdir"
2612 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2613 done
2614 fi
2615 fi
2616 if test "X$ltrpathdirs" != "X"; then
2617 dnl When using libtool, the option that works for both libraries and
2618 dnl executables is -R. The -R options are cumulative.
2619 for found_dir in $ltrpathdirs; do
2620 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2621 done
2622 fi
2623 popdef([P_A_C_K])
2624 popdef([PACKLIBS])
2625 popdef([PACKUP])
2626 popdef([PACK])
2627 popdef([NAME])
2628 ])
2629
2630 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2631 dnl unless already present in VAR.
2632 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2633 dnl contains two or three consecutive elements that belong together.
2634 AC_DEFUN([AC_LIB_APPENDTOVAR],
2635 [
2636 for element in [$2]; do
2637 haveit=
2638 for x in $[$1]; do
2639 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2640 if test "X$x" = "X$element"; then
2641 haveit=yes
2642 break
2643 fi
2644 done
2645 if test -z "$haveit"; then
2646 [$1]="${[$1]}${[$1]:+ }$element"
2647 fi
2648 done
2649 ])
2650
2651 dnl For those cases where a variable contains several -L and -l options
2652 dnl referring to unknown libraries and directories, this macro determines the
2653 dnl necessary additional linker options for the runtime path.
2654 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
2655 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
2656 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
2657 dnl otherwise linking without libtool is assumed.
2658 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
2659 [
2660 AC_REQUIRE([AC_LIB_RPATH])
2661 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2662 $1=
2663 if test "$enable_rpath" != no; then
2664 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2665 dnl Use an explicit option to hardcode directories into the resulting
2666 dnl binary.
2667 rpathdirs=
2668 next=
2669 for opt in $2; do
2670 if test -n "$next"; then
2671 dir="$next"
2672 dnl No need to hardcode the standard /usr/lib.
2673 if test "X$dir" != "X/usr/$acl_libdirstem" \
2674 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
2675 rpathdirs="$rpathdirs $dir"
2676 fi
2677 next=
2678 else
2679 case $opt in
2680 -L) next=yes ;;
2681 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
2682 dnl No need to hardcode the standard /usr/lib.
2683 if test "X$dir" != "X/usr/$acl_libdirstem" \
2684 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
2685 rpathdirs="$rpathdirs $dir"
2686 fi
2687 next= ;;
2688 *) next= ;;
2689 esac
2690 fi
2691 done
2692 if test "X$rpathdirs" != "X"; then
2693 if test -n ""$3""; then
2694 dnl libtool is used for linking. Use -R options.
2695 for dir in $rpathdirs; do
2696 $1="${$1}${$1:+ }-R$dir"
2697 done
2698 else
2699 dnl The linker is used for linking directly.
2700 if test -n "$acl_hardcode_libdir_separator"; then
2701 dnl Weird platform: only the last -rpath option counts, the user
2702 dnl must pass all path elements in one option.
2703 alldirs=
2704 for dir in $rpathdirs; do
2705 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
2706 done
2707 acl_save_libdir="$libdir"
2708 libdir="$alldirs"
2709 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2710 libdir="$acl_save_libdir"
2711 $1="$flag"
2712 else
2713 dnl The -rpath options are cumulative.
2714 for dir in $rpathdirs; do
2715 acl_save_libdir="$libdir"
2716 libdir="$dir"
2717 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2718 libdir="$acl_save_libdir"
2719 $1="${$1}${$1:+ }$flag"
2720 done
2721 fi
2722 fi
2723 fi
2724 fi
2725 fi
2726 AC_SUBST([$1])
2727 ])
2728
2729 # lib-prefix.m4 serial 7 (gettext-0.18)
2730 dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
2731 dnl This file is free software; the Free Software Foundation
2732 dnl gives unlimited permission to copy and/or distribute it,
2733 dnl with or without modifications, as long as this notice is preserved.
2734
2735 dnl From Bruno Haible.
2736
2737 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
2738 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
2739 dnl require excessive bracketing.
2740 ifdef([AC_HELP_STRING],
2741 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
2742 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
2743
2744 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2745 dnl to access previously installed libraries. The basic assumption is that
2746 dnl a user will want packages to use other packages he previously installed
2747 dnl with the same --prefix option.
2748 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2749 dnl libraries, but is otherwise very convenient.
2750 AC_DEFUN([AC_LIB_PREFIX],
2751 [
2752 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2753 AC_REQUIRE([AC_PROG_CC])
2754 AC_REQUIRE([AC_CANONICAL_HOST])
2755 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2756 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2757 dnl By default, look in $includedir and $libdir.
2758 use_additional=yes
2759 AC_LIB_WITH_FINAL_PREFIX([
2760 eval additional_includedir=\"$includedir\"
2761 eval additional_libdir=\"$libdir\"
2762 ])
2763 AC_LIB_ARG_WITH([lib-prefix],
2764 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2765 --without-lib-prefix don't search for libraries in includedir and libdir],
2766 [
2767 if test "X$withval" = "Xno"; then
2768 use_additional=no
2769 else
2770 if test "X$withval" = "X"; then
2771 AC_LIB_WITH_FINAL_PREFIX([
2772 eval additional_includedir=\"$includedir\"
2773 eval additional_libdir=\"$libdir\"
2774 ])
2775 else
2776 additional_includedir="$withval/include"
2777 additional_libdir="$withval/$acl_libdirstem"
2778 fi
2779 fi
2780 ])
2781 if test $use_additional = yes; then
2782 dnl Potentially add $additional_includedir to $CPPFLAGS.
2783 dnl But don't add it
2784 dnl 1. if it's the standard /usr/include,
2785 dnl 2. if it's already present in $CPPFLAGS,
2786 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
2787 dnl 4. if it doesn't exist as a directory.
2788 if test "X$additional_includedir" != "X/usr/include"; then
2789 haveit=
2790 for x in $CPPFLAGS; do
2791 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2792 if test "X$x" = "X-I$additional_includedir"; then
2793 haveit=yes
2794 break
2795 fi
2796 done
2797 if test -z "$haveit"; then
2798 if test "X$additional_includedir" = "X/usr/local/include"; then
2799 if test -n "$GCC"; then
2800 case $host_os in
2801 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2802 esac
2803 fi
2804 fi
2805 if test -z "$haveit"; then
2806 if test -d "$additional_includedir"; then
2807 dnl Really add $additional_includedir to $CPPFLAGS.
2808 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2809 fi
2810 fi
2811 fi
2812 fi
2813 dnl Potentially add $additional_libdir to $LDFLAGS.
2814 dnl But don't add it
2815 dnl 1. if it's the standard /usr/lib,
2816 dnl 2. if it's already present in $LDFLAGS,
2817 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
2818 dnl 4. if it doesn't exist as a directory.
2819 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2820 haveit=
2821 for x in $LDFLAGS; do
2822 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2823 if test "X$x" = "X-L$additional_libdir"; then
2824 haveit=yes
2825 break
2826 fi
2827 done
2828 if test -z "$haveit"; then
2829 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2830 if test -n "$GCC"; then
2831 case $host_os in
2832 linux*) haveit=yes;;
2833 esac
2834 fi
2835 fi
2836 if test -z "$haveit"; then
2837 if test -d "$additional_libdir"; then
2838 dnl Really add $additional_libdir to $LDFLAGS.
2839 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2840 fi
2841 fi
2842 fi
2843 fi
2844 fi
2845 ])
2846
2847 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2848 dnl acl_final_exec_prefix, containing the values to which $prefix and
2849 dnl $exec_prefix will expand at the end of the configure script.
2850 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2851 [
2852 dnl Unfortunately, prefix and exec_prefix get only finally determined
2853 dnl at the end of configure.
2854 if test "X$prefix" = "XNONE"; then
2855 acl_final_prefix="$ac_default_prefix"
2856 else
2857 acl_final_prefix="$prefix"
2858 fi
2859 if test "X$exec_prefix" = "XNONE"; then
2860 acl_final_exec_prefix='${prefix}'
2861 else
2862 acl_final_exec_prefix="$exec_prefix"
2863 fi
2864 acl_save_prefix="$prefix"
2865 prefix="$acl_final_prefix"
2866 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2867 prefix="$acl_save_prefix"
2868 ])
2869
2870 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2871 dnl variables prefix and exec_prefix bound to the values they will have
2872 dnl at the end of the configure script.
2873 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2874 [
2875 acl_save_prefix="$prefix"
2876 prefix="$acl_final_prefix"
2877 acl_save_exec_prefix="$exec_prefix"
2878 exec_prefix="$acl_final_exec_prefix"
2879 $1
2880 exec_prefix="$acl_save_exec_prefix"
2881 prefix="$acl_save_prefix"
2882 ])
2883
2884 dnl AC_LIB_PREPARE_MULTILIB creates
2885 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
2886 dnl "lib" or "lib64" or "lib/64",
2887 dnl - a variable acl_libdirstem2, as a secondary possible value for
2888 dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
2889 dnl "lib/amd64".
2890 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2891 [
2892 dnl There is no formal standard regarding lib and lib64.
2893 dnl On glibc systems, the current practice is that on a system supporting
2894 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2895 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
2896 dnl the compiler's default mode by looking at the compiler's library search
2897 dnl path. If at least one of its elements ends in /lib64 or points to a
2898 dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
2899 dnl Otherwise we use the default, namely "lib".
2900 dnl On Solaris systems, the current practice is that on a system supporting
2901 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2902 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
2903 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
2904 AC_REQUIRE([AC_CANONICAL_HOST])
2905 acl_libdirstem=lib
2906 acl_libdirstem2=
2907 case "$host_os" in
2908 solaris*)
2909 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
2910 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
2911 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
2912 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
2913 dnl symlink is missing, so we set acl_libdirstem2 too.
2914 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
2915 [AC_EGREP_CPP([sixtyfour bits], [
2916 #ifdef _LP64
2917 sixtyfour bits
2918 #endif
2919 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
2920 ])
2921 if test $gl_cv_solaris_64bit = yes; then
2922 acl_libdirstem=lib/64
2923 case "$host_cpu" in
2924 sparc*) acl_libdirstem2=lib/sparcv9 ;;
2925 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
2926 esac
2927 fi
2928 ;;
2929 *)
2930 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2931 if test -n "$searchpath"; then
2932 acl_save_IFS="${IFS= }"; IFS=":"
2933 for searchdir in $searchpath; do
2934 if test -d "$searchdir"; then
2935 case "$searchdir" in
2936 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
2937 */../ | */.. )
2938 # Better ignore directories of this form. They are misleading.
2939 ;;
2940 *) searchdir=`cd "$searchdir" && pwd`
2941 case "$searchdir" in
2942 */lib64 ) acl_libdirstem=lib64 ;;
2943 esac ;;
2944 esac
2945 fi
2946 done
2947 IFS="$acl_save_IFS"
2948 fi
2949 ;;
2950 esac
2951 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
2952 ])
2953
2954 # nls.m4 serial 5 (gettext-0.18)
2955 dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software
2956 dnl Foundation, Inc.
2957 dnl This file is free software; the Free Software Foundation
2958 dnl gives unlimited permission to copy and/or distribute it,
2959 dnl with or without modifications, as long as this notice is preserved.
2960 dnl
2961 dnl This file can be used in projects which are not available under
2962 dnl the GNU General Public License or the GNU Library General Public
2963 dnl License but which still want to provide support for the GNU gettext
2964 dnl functionality.
2965 dnl Please note that the actual code of the GNU gettext library is covered
2966 dnl by the GNU Library General Public License, and the rest of the GNU
2967 dnl gettext package is covered by the GNU General Public License.
2968 dnl They are *not* in the public domain.
2969
2970 dnl Authors:
2971 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2972 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2973
2974 AC_PREREQ([2.50])
2975
2976 AC_DEFUN([AM_NLS],
2977 [
2978 AC_MSG_CHECKING([whether NLS is requested])
2979 dnl Default is enabled NLS
2980 AC_ARG_ENABLE([nls],
2981 [ --disable-nls do not use Native Language Support],
2982 USE_NLS=$enableval, USE_NLS=yes)
2983 AC_MSG_RESULT([$USE_NLS])
2984 AC_SUBST([USE_NLS])
2985 ])
2986
2987 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2988 # serial 11 (pkg-config-0.29.1)
2989
2990 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2991 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
2992 dnl
2993 dnl This program is free software; you can redistribute it and/or modify
2994 dnl it under the terms of the GNU General Public License as published by
2995 dnl the Free Software Foundation; either version 2 of the License, or
2996 dnl (at your option) any later version.
2997 dnl
2998 dnl This program is distributed in the hope that it will be useful, but
2999 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
3000 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3001 dnl General Public License for more details.
3002 dnl
3003 dnl You should have received a copy of the GNU General Public License
3004 dnl along with this program; if not, write to the Free Software
3005 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3006 dnl 02111-1307, USA.
3007 dnl
3008 dnl As a special exception to the GNU General Public License, if you
3009 dnl distribute this file as part of a program that contains a
3010 dnl configuration script generated by Autoconf, you may include it under
3011 dnl the same distribution terms that you use for the rest of that
3012 dnl program.
3013
3014 dnl PKG_PREREQ(MIN-VERSION)
3015 dnl -----------------------
3016 dnl Since: 0.29
3017 dnl
3018 dnl Verify that the version of the pkg-config macros are at least
3019 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
3020 dnl installed version of pkg-config, this checks the developer's version
3021 dnl of pkg.m4 when generating configure.
3022 dnl
3023 dnl To ensure that this macro is defined, also add:
3024 dnl m4_ifndef([PKG_PREREQ],
3025 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
3026 dnl
3027 dnl See the "Since" comment for each macro you use to see what version
3028 dnl of the macros you require.
3029 m4_defun([PKG_PREREQ],
3030 [m4_define([PKG_MACROS_VERSION], [0.29.1])
3031 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
3032 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
3033 ])dnl PKG_PREREQ
3034
3035 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
3036 dnl ----------------------------------
3037 dnl Since: 0.16
3038 dnl
3039 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
3040 dnl first found in the path. Checks that the version of pkg-config found
3041 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
3042 dnl used since that's the first version where most current features of
3043 dnl pkg-config existed.
3044 AC_DEFUN([PKG_PROG_PKG_CONFIG],
3045 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
3046 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
3047 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
3048 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
3049 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
3050 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
3051
3052 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
3053 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
3054 fi
3055 if test -n "$PKG_CONFIG"; then
3056 _pkg_min_version=m4_default([$1], [0.9.0])
3057 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
3058 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
3059 AC_MSG_RESULT([yes])
3060 else
3061 AC_MSG_RESULT([no])
3062 PKG_CONFIG=""
3063 fi
3064 fi[]dnl
3065 ])dnl PKG_PROG_PKG_CONFIG
3066
3067 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3068 dnl -------------------------------------------------------------------
3069 dnl Since: 0.18
3070 dnl
3071 dnl Check to see whether a particular set of modules exists. Similar to
3072 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
3073 dnl
3074 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3075 dnl only at the first occurence in configure.ac, so if the first place
3076 dnl it's called might be skipped (such as if it is within an "if", you
3077 dnl have to call PKG_CHECK_EXISTS manually
3078 AC_DEFUN([PKG_CHECK_EXISTS],
3079 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3080 if test -n "$PKG_CONFIG" && \
3081 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
3082 m4_default([$2], [:])
3083 m4_ifvaln([$3], [else
3084 $3])dnl
3085 fi])
3086
3087 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
3088 dnl ---------------------------------------------
3089 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
3090 dnl pkg_failed based on the result.
3091 m4_define([_PKG_CONFIG],
3092 [if test -n "$$1"; then
3093 pkg_cv_[]$1="$$1"
3094 elif test -n "$PKG_CONFIG"; then
3095 PKG_CHECK_EXISTS([$3],
3096 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
3097 test "x$?" != "x0" && pkg_failed=yes ],
3098 [pkg_failed=yes])
3099 else
3100 pkg_failed=untried
3101 fi[]dnl
3102 ])dnl _PKG_CONFIG
3103
3104 dnl _PKG_SHORT_ERRORS_SUPPORTED
3105 dnl ---------------------------
3106 dnl Internal check to see if pkg-config supports short errors.
3107 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
3108 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3109 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
3110 _pkg_short_errors_supported=yes
3111 else
3112 _pkg_short_errors_supported=no
3113 fi[]dnl
3114 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
3115
3116
3117 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
3118 dnl [ACTION-IF-NOT-FOUND])
3119 dnl --------------------------------------------------------------
3120 dnl Since: 0.4.0
3121 dnl
3122 dnl Note that if there is a possibility the first call to
3123 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
3124 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
3125 AC_DEFUN([PKG_CHECK_MODULES],
3126 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3127 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
3128 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
3129
3130 pkg_failed=no
3131 AC_MSG_CHECKING([for $1])
3132
3133 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
3134 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
3135
3136 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
3137 and $1[]_LIBS to avoid the need to call pkg-config.
3138 See the pkg-config man page for more details.])
3139
3140 if test $pkg_failed = yes; then
3141 AC_MSG_RESULT([no])
3142 _PKG_SHORT_ERRORS_SUPPORTED
3143 if test $_pkg_short_errors_supported = yes; then
3144 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
3145 else
3146 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
3147 fi
3148 # Put the nasty error message in config.log where it belongs
3149 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
3150
3151 m4_default([$4], [AC_MSG_ERROR(
3152 [Package requirements ($2) were not met:
3153
3154 $$1_PKG_ERRORS
3155
3156 Consider adjusting the PKG_CONFIG_PATH environment variable if you
3157 installed software in a non-standard prefix.
3158
3159 _PKG_TEXT])[]dnl
3160 ])
3161 elif test $pkg_failed = untried; then
3162 AC_MSG_RESULT([no])
3163 m4_default([$4], [AC_MSG_FAILURE(
3164 [The pkg-config script could not be found or is too old. Make sure it
3165 is in your PATH or set the PKG_CONFIG environment variable to the full
3166 path to pkg-config.
3167
3168 _PKG_TEXT
3169
3170 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
3171 ])
3172 else
3173 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
3174 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
3175 AC_MSG_RESULT([yes])
3176 $3
3177 fi[]dnl
3178 ])dnl PKG_CHECK_MODULES
3179
3180
3181 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
3182 dnl [ACTION-IF-NOT-FOUND])
3183 dnl ---------------------------------------------------------------------
3184 dnl Since: 0.29
3185 dnl
3186 dnl Checks for existence of MODULES and gathers its build flags with
3187 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
3188 dnl and VARIABLE-PREFIX_LIBS from --libs.
3189 dnl
3190 dnl Note that if there is a possibility the first call to
3191 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
3192 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
3193 dnl configure.ac.
3194 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
3195 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3196 _save_PKG_CONFIG=$PKG_CONFIG
3197 PKG_CONFIG="$PKG_CONFIG --static"
3198 PKG_CHECK_MODULES($@)
3199 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
3200 ])dnl PKG_CHECK_MODULES_STATIC
3201
3202
3203 dnl PKG_INSTALLDIR([DIRECTORY])
3204 dnl -------------------------
3205 dnl Since: 0.27
3206 dnl
3207 dnl Substitutes the variable pkgconfigdir as the location where a module
3208 dnl should install pkg-config .pc files. By default the directory is
3209 dnl $libdir/pkgconfig, but the default can be changed by passing
3210 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
3211 dnl parameter.
3212 AC_DEFUN([PKG_INSTALLDIR],
3213 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
3214 m4_pushdef([pkg_description],
3215 [pkg-config installation directory @<:@]pkg_default[@:>@])
3216 AC_ARG_WITH([pkgconfigdir],
3217 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
3218 [with_pkgconfigdir=]pkg_default)
3219 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
3220 m4_popdef([pkg_default])
3221 m4_popdef([pkg_description])
3222 ])dnl PKG_INSTALLDIR
3223
3224
3225 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
3226 dnl --------------------------------
3227 dnl Since: 0.27
3228 dnl
3229 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
3230 dnl module should install arch-independent pkg-config .pc files. By
3231 dnl default the directory is $datadir/pkgconfig, but the default can be
3232 dnl changed by passing DIRECTORY. The user can override through the
3233 dnl --with-noarch-pkgconfigdir parameter.
3234 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
3235 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
3236 m4_pushdef([pkg_description],
3237 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
3238 AC_ARG_WITH([noarch-pkgconfigdir],
3239 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
3240 [with_noarch_pkgconfigdir=]pkg_default)
3241 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
3242 m4_popdef([pkg_default])
3243 m4_popdef([pkg_description])
3244 ])dnl PKG_NOARCH_INSTALLDIR
3245
3246
3247 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
3248 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3249 dnl -------------------------------------------
3250 dnl Since: 0.28
3251 dnl
3252 dnl Retrieves the value of the pkg-config variable for the given module.
3253 AC_DEFUN([PKG_CHECK_VAR],
3254 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3255 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
3256
3257 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
3258 AS_VAR_COPY([$1], [pkg_cv_][$1])
3259
3260 AS_VAR_IF([$1], [""], [$5], [$4])dnl
3261 ])dnl PKG_CHECK_VAR
3262
3263 dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
3264 dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
3265 dnl [DESCRIPTION], [DEFAULT])
3266 dnl ------------------------------------------
3267 dnl
3268 dnl Prepare a "--with-" configure option using the lowercase
3269 dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
3270 dnl PKG_CHECK_MODULES in a single macro.
3271 AC_DEFUN([PKG_WITH_MODULES],
3272 [
3273 m4_pushdef([with_arg], m4_tolower([$1]))
3274
3275 m4_pushdef([description],
3276 [m4_default([$5], [build with ]with_arg[ support])])
3277
3278 m4_pushdef([def_arg], [m4_default([$6], [auto])])
3279 m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
3280 m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
3281
3282 m4_case(def_arg,
3283 [yes],[m4_pushdef([with_without], [--without-]with_arg)],
3284 [m4_pushdef([with_without],[--with-]with_arg)])
3285
3286 AC_ARG_WITH(with_arg,
3287 AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
3288 [AS_TR_SH([with_]with_arg)=def_arg])
3289
3290 AS_CASE([$AS_TR_SH([with_]with_arg)],
3291 [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
3292 [auto],[PKG_CHECK_MODULES([$1],[$2],
3293 [m4_n([def_action_if_found]) $3],
3294 [m4_n([def_action_if_not_found]) $4])])
3295
3296 m4_popdef([with_arg])
3297 m4_popdef([description])
3298 m4_popdef([def_arg])
3299
3300 ])dnl PKG_WITH_MODULES
3301
3302 dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
3303 dnl [DESCRIPTION], [DEFAULT])
3304 dnl -----------------------------------------------
3305 dnl
3306 dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
3307 dnl check._[VARIABLE-PREFIX] is exported as make variable.
3308 AC_DEFUN([PKG_HAVE_WITH_MODULES],
3309 [
3310 PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
3311
3312 AM_CONDITIONAL([HAVE_][$1],
3313 [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
3314 ])dnl PKG_HAVE_WITH_MODULES
3315
3316 dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
3317 dnl [DESCRIPTION], [DEFAULT])
3318 dnl ------------------------------------------------------
3319 dnl
3320 dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
3321 dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
3322 dnl and preprocessor variable.
3323 AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
3324 [
3325 PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
3326
3327 AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
3328 [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
3329 ])dnl PKG_HAVE_DEFINE_WITH_MODULES
3330
3331 # po.m4 serial 24 (gettext-0.19)
3332 dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
3333 dnl This file is free software; the Free Software Foundation
3334 dnl gives unlimited permission to copy and/or distribute it,
3335 dnl with or without modifications, as long as this notice is preserved.
3336 dnl
3337 dnl This file can be used in projects which are not available under
3338 dnl the GNU General Public License or the GNU Library General Public
3339 dnl License but which still want to provide support for the GNU gettext
3340 dnl functionality.
3341 dnl Please note that the actual code of the GNU gettext library is covered
3342 dnl by the GNU Library General Public License, and the rest of the GNU
3343 dnl gettext package is covered by the GNU General Public License.
3344 dnl They are *not* in the public domain.
3345
3346 dnl Authors:
3347 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3348 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3349
3350 AC_PREREQ([2.60])
3351
3352 dnl Checks for all prerequisites of the po subdirectory.
3353 AC_DEFUN([AM_PO_SUBDIRS],
3354 [
3355 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3356 AC_REQUIRE([AC_PROG_INSTALL])dnl
3357 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3358 AC_REQUIRE([AC_PROG_SED])dnl
3359 AC_REQUIRE([AM_NLS])dnl
3360
3361 dnl Release version of the gettext macros. This is used to ensure that
3362 dnl the gettext macros and po/Makefile.in.in are in sync.
3363 AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
3364
3365 dnl Perform the following tests also if --disable-nls has been given,
3366 dnl because they are needed for "make dist" to work.
3367
3368 dnl Search for GNU msgfmt in the PATH.
3369 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3370 dnl The second test excludes FreeBSD msgfmt.
3371 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3372 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3373 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3374 :)
3375 AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
3376
3377 dnl Test whether it is GNU msgfmt >= 0.15.
3378 changequote(,)dnl
3379 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3380 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
3381 *) MSGFMT_015=$MSGFMT ;;
3382 esac
3383 changequote([,])dnl
3384 AC_SUBST([MSGFMT_015])
3385 changequote(,)dnl
3386 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3387 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
3388 *) GMSGFMT_015=$GMSGFMT ;;
3389 esac
3390 changequote([,])dnl
3391 AC_SUBST([GMSGFMT_015])
3392
3393 dnl Search for GNU xgettext 0.12 or newer in the PATH.
3394 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3395 dnl The second test excludes FreeBSD xgettext.
3396 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3397 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3398 (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)],
3399 :)
3400 dnl Remove leftover from FreeBSD xgettext call.
3401 rm -f messages.po
3402
3403 dnl Test whether it is GNU xgettext >= 0.15.
3404 changequote(,)dnl
3405 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3406 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
3407 *) XGETTEXT_015=$XGETTEXT ;;
3408 esac
3409 changequote([,])dnl
3410 AC_SUBST([XGETTEXT_015])
3411
3412 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3413 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3414 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
3415
3416 dnl Installation directories.
3417 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
3418 dnl have to define it here, so that it can be used in po/Makefile.
3419 test -n "$localedir" || localedir='${datadir}/locale'
3420 AC_SUBST([localedir])
3421
3422 dnl Support for AM_XGETTEXT_OPTION.
3423 test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
3424 AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
3425
3426 AC_CONFIG_COMMANDS([po-directories], [[
3427 for ac_file in $CONFIG_FILES; do
3428 # Support "outfile[:infile[:infile...]]"
3429 case "$ac_file" in
3430 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3431 esac
3432 # PO directories have a Makefile.in generated from Makefile.in.in.
3433 case "$ac_file" in */Makefile.in)
3434 # Adjust a relative srcdir.
3435 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3436 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3437 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3438 # In autoconf-2.13 it is called $ac_given_srcdir.
3439 # In autoconf-2.50 it is called $srcdir.
3440 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3441 case "$ac_given_srcdir" in
3442 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3443 /*) top_srcdir="$ac_given_srcdir" ;;
3444 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3445 esac
3446 # Treat a directory as a PO directory if and only if it has a
3447 # POTFILES.in file. This allows packages to have multiple PO
3448 # directories under different names or in different locations.
3449 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3450 rm -f "$ac_dir/POTFILES"
3451 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3452 gt_tab=`printf '\t'`
3453 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"
3454 POMAKEFILEDEPS="POTFILES.in"
3455 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
3456 # on $ac_dir but don't depend on user-specified configuration
3457 # parameters.
3458 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3459 # The LINGUAS file contains the set of available languages.
3460 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3461 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3462 fi
3463 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3464 # Hide the ALL_LINGUAS assignment from automake < 1.5.
3465 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3466 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3467 else
3468 # The set of available languages was given in configure.in.
3469 # Hide the ALL_LINGUAS assignment from automake < 1.5.
3470 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
3471 fi
3472 # Compute POFILES
3473 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3474 # Compute UPDATEPOFILES
3475 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3476 # Compute DUMMYPOFILES
3477 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3478 # Compute GMOFILES
3479 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3480 case "$ac_given_srcdir" in
3481 .) srcdirpre= ;;
3482 *) srcdirpre='$(srcdir)/' ;;
3483 esac
3484 POFILES=
3485 UPDATEPOFILES=
3486 DUMMYPOFILES=
3487 GMOFILES=
3488 for lang in $ALL_LINGUAS; do
3489 POFILES="$POFILES $srcdirpre$lang.po"
3490 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3491 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3492 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3493 done
3494 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3495 # environment variable.
3496 INST_LINGUAS=
3497 if test -n "$ALL_LINGUAS"; then
3498 for presentlang in $ALL_LINGUAS; do
3499 useit=no
3500 if test "%UNSET%" != "$LINGUAS"; then
3501 desiredlanguages="$LINGUAS"
3502 else
3503 desiredlanguages="$ALL_LINGUAS"
3504 fi
3505 for desiredlang in $desiredlanguages; do
3506 # Use the presentlang catalog if desiredlang is
3507 # a. equal to presentlang, or
3508 # b. a variant of presentlang (because in this case,
3509 # presentlang can be used as a fallback for messages
3510 # which are not translated in the desiredlang catalog).
3511 case "$desiredlang" in
3512 "$presentlang"*) useit=yes;;
3513 esac
3514 done
3515 if test $useit = yes; then
3516 INST_LINGUAS="$INST_LINGUAS $presentlang"
3517 fi
3518 done
3519 fi
3520 CATALOGS=
3521 if test -n "$INST_LINGUAS"; then
3522 for lang in $INST_LINGUAS; do
3523 CATALOGS="$CATALOGS $lang.gmo"
3524 done
3525 fi
3526 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3527 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"
3528 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3529 if test -f "$f"; then
3530 case "$f" in
3531 *.orig | *.bak | *~) ;;
3532 *) cat "$f" >> "$ac_dir/Makefile" ;;
3533 esac
3534 fi
3535 done
3536 fi
3537 ;;
3538 esac
3539 done]],
3540 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3541 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
3542 # from automake < 1.5.
3543 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
3544 # Capture the value of LINGUAS because we need it to compute CATALOGS.
3545 LINGUAS="${LINGUAS-%UNSET%}"
3546 ])
3547 ])
3548
3549 dnl Postprocesses a Makefile in a directory containing PO files.
3550 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
3551 [
3552 # When this code is run, in config.status, two variables have already been
3553 # set:
3554 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
3555 # - LINGUAS is the value of the environment variable LINGUAS at configure
3556 # time.
3557
3558 changequote(,)dnl
3559 # Adjust a relative srcdir.
3560 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3561 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3562 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3563 # In autoconf-2.13 it is called $ac_given_srcdir.
3564 # In autoconf-2.50 it is called $srcdir.
3565 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3566 case "$ac_given_srcdir" in
3567 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3568 /*) top_srcdir="$ac_given_srcdir" ;;
3569 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3570 esac
3571
3572 # Find a way to echo strings without interpreting backslash.
3573 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
3574 gt_echo='echo'
3575 else
3576 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
3577 gt_echo='printf %s\n'
3578 else
3579 echo_func () {
3580 cat <<EOT
3581 $*
3582 EOT
3583 }
3584 gt_echo='echo_func'
3585 fi
3586 fi
3587
3588 # A sed script that extracts the value of VARIABLE from a Makefile.
3589 tab=`printf '\t'`
3590 sed_x_variable='
3591 # Test if the hold space is empty.
3592 x
3593 s/P/P/
3594 x
3595 ta
3596 # Yes it was empty. Look if we have the expected variable definition.
3597 /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
3598 # Seen the first line of the variable definition.
3599 s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
3600 ba
3601 }
3602 bd
3603 :a
3604 # Here we are processing a line from the variable definition.
3605 # Remove comment, more precisely replace it with a space.
3606 s/#.*$/ /
3607 # See if the line ends in a backslash.
3608 tb
3609 :b
3610 s/\\$//
3611 # Print the line, without the trailing backslash.
3612 p
3613 tc
3614 # There was no trailing backslash. The end of the variable definition is
3615 # reached. Clear the hold space.
3616 s/^.*$//
3617 x
3618 bd
3619 :c
3620 # A trailing backslash means that the variable definition continues in the
3621 # next line. Put a nonempty string into the hold space to indicate this.
3622 s/^.*$/P/
3623 x
3624 :d
3625 '
3626 changequote([,])dnl
3627
3628 # Set POTFILES to the value of the Makefile variable POTFILES.
3629 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
3630 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
3631 # Compute POTFILES_DEPS as
3632 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
3633 POTFILES_DEPS=
3634 for file in $POTFILES; do
3635 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
3636 done
3637 POMAKEFILEDEPS=""
3638
3639 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3640 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3641 fi
3642 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3643 # The LINGUAS file contains the set of available languages.
3644 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3645 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3646 else
3647 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
3648 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
3649 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
3650 fi
3651 # Hide the ALL_LINGUAS assignment from automake < 1.5.
3652 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3653 # Compute POFILES
3654 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3655 # Compute UPDATEPOFILES
3656 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3657 # Compute DUMMYPOFILES
3658 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3659 # Compute GMOFILES
3660 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3661 # Compute PROPERTIESFILES
3662 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
3663 # Compute CLASSFILES
3664 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
3665 # Compute QMFILES
3666 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3667 # Compute MSGFILES
3668 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
3669 # Compute RESOURCESDLLFILES
3670 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
3671 case "$ac_given_srcdir" in
3672 .) srcdirpre= ;;
3673 *) srcdirpre='$(srcdir)/' ;;
3674 esac
3675 POFILES=
3676 UPDATEPOFILES=
3677 DUMMYPOFILES=
3678 GMOFILES=
3679 PROPERTIESFILES=
3680 CLASSFILES=
3681 QMFILES=
3682 MSGFILES=
3683 RESOURCESDLLFILES=
3684 for lang in $ALL_LINGUAS; do
3685 POFILES="$POFILES $srcdirpre$lang.po"
3686 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3687 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3688 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3689 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
3690 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
3691 QMFILES="$QMFILES $srcdirpre$lang.qm"
3692 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3693 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
3694 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/'`
3695 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
3696 done
3697 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3698 # environment variable.
3699 INST_LINGUAS=
3700 if test -n "$ALL_LINGUAS"; then
3701 for presentlang in $ALL_LINGUAS; do
3702 useit=no
3703 if test "%UNSET%" != "$LINGUAS"; then
3704 desiredlanguages="$LINGUAS"
3705 else
3706 desiredlanguages="$ALL_LINGUAS"
3707 fi
3708 for desiredlang in $desiredlanguages; do
3709 # Use the presentlang catalog if desiredlang is
3710 # a. equal to presentlang, or
3711 # b. a variant of presentlang (because in this case,
3712 # presentlang can be used as a fallback for messages
3713 # which are not translated in the desiredlang catalog).
3714 case "$desiredlang" in
3715 "$presentlang"*) useit=yes;;
3716 esac
3717 done
3718 if test $useit = yes; then
3719 INST_LINGUAS="$INST_LINGUAS $presentlang"
3720 fi
3721 done
3722 fi
3723 CATALOGS=
3724 JAVACATALOGS=
3725 QTCATALOGS=
3726 TCLCATALOGS=
3727 CSHARPCATALOGS=
3728 if test -n "$INST_LINGUAS"; then
3729 for lang in $INST_LINGUAS; do
3730 CATALOGS="$CATALOGS $lang.gmo"
3731 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
3732 QTCATALOGS="$QTCATALOGS $lang.qm"
3733 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3734 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
3735 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/'`
3736 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
3737 done
3738 fi
3739
3740 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"
3741 tab=`printf '\t'`
3742 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
3743 # Add dependencies that cannot be formulated as a simple suffix rule.
3744 for lang in $ALL_LINGUAS; do
3745 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3746 cat >> "$ac_file.tmp" <<EOF
3747 $frobbedlang.msg: $lang.po
3748 ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
3749 ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3750 EOF
3751 done
3752 fi
3753 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
3754 # Add dependencies that cannot be formulated as a simple suffix rule.
3755 for lang in $ALL_LINGUAS; do
3756 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/'`
3757 cat >> "$ac_file.tmp" <<EOF
3758 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
3759 ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
3760 ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3761 EOF
3762 done
3763 fi
3764 if test -n "$POMAKEFILEDEPS"; then
3765 cat >> "$ac_file.tmp" <<EOF
3766 Makefile: $POMAKEFILEDEPS
3767 EOF
3768 fi
3769 mv "$ac_file.tmp" "$ac_file"
3770 ])
3771
3772 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
3773 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
3774 [
3775 XGETTEXT_EXTRA_OPTIONS=
3776 ])
3777
3778 dnl Registers an option to be passed to xgettext in the po subdirectory.
3779 AC_DEFUN([AM_XGETTEXT_OPTION],
3780 [
3781 AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
3782 XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
3783 ])
3784
3785 # progtest.m4 serial 7 (gettext-0.18.2)
3786 dnl Copyright (C) 1996-2003, 2005, 2008-2016 Free Software Foundation, Inc.
3787 dnl This file is free software; the Free Software Foundation
3788 dnl gives unlimited permission to copy and/or distribute it,
3789 dnl with or without modifications, as long as this notice is preserved.
3790 dnl
3791 dnl This file can be used in projects which are not available under
3792 dnl the GNU General Public License or the GNU Library General Public
3793 dnl License but which still want to provide support for the GNU gettext
3794 dnl functionality.
3795 dnl Please note that the actual code of the GNU gettext library is covered
3796 dnl by the GNU Library General Public License, and the rest of the GNU
3797 dnl gettext package is covered by the GNU General Public License.
3798 dnl They are *not* in the public domain.
3799
3800 dnl Authors:
3801 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
3802
3803 AC_PREREQ([2.50])
3804
3805 # Search path for a program which passes the given test.
3806
3807 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3808 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3809 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3810 [
3811 # Prepare PATH_SEPARATOR.
3812 # The user is always right.
3813 if test "${PATH_SEPARATOR+set}" != set; then
3814 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
3815 # contains only /bin. Note that ksh looks also at the FPATH variable,
3816 # so we have to set that as well for the test.
3817 PATH_SEPARATOR=:
3818 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
3819 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
3820 || PATH_SEPARATOR=';'
3821 }
3822 fi
3823
3824 # Find out how to test for executable files. Don't use a zero-byte file,
3825 # as systems may use methods other than mode bits to determine executability.
3826 cat >conf$$.file <<_ASEOF
3827 #! /bin/sh
3828 exit 0
3829 _ASEOF
3830 chmod +x conf$$.file
3831 if test -x conf$$.file >/dev/null 2>&1; then
3832 ac_executable_p="test -x"
3833 else
3834 ac_executable_p="test -f"
3835 fi
3836 rm -f conf$$.file
3837
3838 # Extract the first word of "$2", so it can be a program name with args.
3839 set dummy $2; ac_word=[$]2
3840 AC_MSG_CHECKING([for $ac_word])
3841 AC_CACHE_VAL([ac_cv_path_$1],
3842 [case "[$]$1" in
3843 [[\\/]]* | ?:[[\\/]]*)
3844 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3845 ;;
3846 *)
3847 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
3848 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3849 IFS="$ac_save_IFS"
3850 test -z "$ac_dir" && ac_dir=.
3851 for ac_exec_ext in '' $ac_executable_extensions; do
3852 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
3853 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
3854 if [$3]; then
3855 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
3856 break 2
3857 fi
3858 fi
3859 done
3860 done
3861 IFS="$ac_save_IFS"
3862 dnl If no 4th arg is given, leave the cache variable unset,
3863 dnl so AC_PATH_PROGS will keep looking.
3864 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3865 ])dnl
3866 ;;
3867 esac])dnl
3868 $1="$ac_cv_path_$1"
3869 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
3870 AC_MSG_RESULT([$][$1])
3871 else
3872 AC_MSG_RESULT([no])
3873 fi
3874 AC_SUBST([$1])dnl
3875 ])
3876
3877 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
3878 #
3879 # This file is free software; the Free Software Foundation
3880 # gives unlimited permission to copy and/or distribute it,
3881 # with or without modifications, as long as this notice is preserved.
3882
3883 # AM_AUTOMAKE_VERSION(VERSION)
3884 # ----------------------------
3885 # Automake X.Y traces this macro to ensure aclocal.m4 has been
3886 # generated from the m4 files accompanying Automake X.Y.
3887 # (This private macro should not be called outside this file.)
3888 AC_DEFUN([AM_AUTOMAKE_VERSION],
3889 [am__api_version='1.16'
3890 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3891 dnl require some minimum version. Point them to the right macro.
3892 m4_if([$1], [1.16.1], [],
3893 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3894 ])
3895
3896 # _AM_AUTOCONF_VERSION(VERSION)
3897 # -----------------------------
3898 # aclocal traces this macro to find the Autoconf version.
3899 # This is a private macro too. Using m4_define simplifies
3900 # the logic in aclocal, which can simply ignore this definition.
3901 m4_define([_AM_AUTOCONF_VERSION], [])
3902
3903 # AM_SET_CURRENT_AUTOMAKE_VERSION
3904 # -------------------------------
3905 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
3906 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
3907 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
3908 [AM_AUTOMAKE_VERSION([1.16.1])dnl
3909 m4_ifndef([AC_AUTOCONF_VERSION],
3910 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
3911 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
3912
3913 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
3914
3915 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
3916 #
3917 # This file is free software; the Free Software Foundation
3918 # gives unlimited permission to copy and/or distribute it,
3919 # with or without modifications, as long as this notice is preserved.
3920
3921 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
3922 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
3923 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
3924 #
3925 # Of course, Automake must honor this variable whenever it calls a
3926 # tool from the auxiliary directory. The problem is that $srcdir (and
3927 # therefore $ac_aux_dir as well) can be either absolute or relative,
3928 # depending on how configure is run. This is pretty annoying, since
3929 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
3930 # source directory, any form will work fine, but in subdirectories a
3931 # relative path needs to be adjusted first.
3932 #
3933 # $ac_aux_dir/missing
3934 # fails when called from a subdirectory if $ac_aux_dir is relative
3935 # $top_srcdir/$ac_aux_dir/missing
3936 # fails if $ac_aux_dir is absolute,
3937 # fails when called from a subdirectory in a VPATH build with
3938 # a relative $ac_aux_dir
3939 #
3940 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
3941 # are both prefixed by $srcdir. In an in-source build this is usually
3942 # harmless because $srcdir is '.', but things will broke when you
3943 # start a VPATH build or use an absolute $srcdir.
3944 #
3945 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
3946 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
3947 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
3948 # and then we would define $MISSING as
3949 # MISSING="\${SHELL} $am_aux_dir/missing"
3950 # This will work as long as MISSING is not called from configure, because
3951 # unfortunately $(top_srcdir) has no meaning in configure.
3952 # However there are other variables, like CC, which are often used in
3953 # configure, and could therefore not use this "fixed" $ac_aux_dir.
3954 #
3955 # Another solution, used here, is to always expand $ac_aux_dir to an
3956 # absolute PATH. The drawback is that using absolute paths prevent a
3957 # configured tree to be moved without reconfiguration.
3958
3959 AC_DEFUN([AM_AUX_DIR_EXPAND],
3960 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3961 # Expand $ac_aux_dir to an absolute path.
3962 am_aux_dir=`cd "$ac_aux_dir" && pwd`
3963 ])
3964
3965 # AM_CONDITIONAL -*- Autoconf -*-
3966
3967 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
3968 #
3969 # This file is free software; the Free Software Foundation
3970 # gives unlimited permission to copy and/or distribute it,
3971 # with or without modifications, as long as this notice is preserved.
3972
3973 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
3974 # -------------------------------------
3975 # Define a conditional.
3976 AC_DEFUN([AM_CONDITIONAL],
3977 [AC_PREREQ([2.52])dnl
3978 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
3979 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
3980 AC_SUBST([$1_TRUE])dnl
3981 AC_SUBST([$1_FALSE])dnl
3982 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
3983 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
3984 m4_define([_AM_COND_VALUE_$1], [$2])dnl
3985 if $2; then
3986 $1_TRUE=
3987 $1_FALSE='#'
3988 else
3989 $1_TRUE='#'
3990 $1_FALSE=
3991 fi
3992 AC_CONFIG_COMMANDS_PRE(
3993 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
3994 AC_MSG_ERROR([[conditional "$1" was never defined.
3995 Usually this means the macro was only invoked conditionally.]])
3996 fi])])
3997
3998 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
3999 #
4000 # This file is free software; the Free Software Foundation
4001 # gives unlimited permission to copy and/or distribute it,
4002 # with or without modifications, as long as this notice is preserved.
4003
4004
4005 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
4006 # written in clear, in which case automake, when reading aclocal.m4,
4007 # will think it sees a *use*, and therefore will trigger all it's
4008 # C support machinery. Also note that it means that autoscan, seeing
4009 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
4010
4011
4012 # _AM_DEPENDENCIES(NAME)
4013 # ----------------------
4014 # See how the compiler implements dependency checking.
4015 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
4016 # We try a few techniques and use that to set a single cache variable.
4017 #
4018 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
4019 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
4020 # dependency, and given that the user is not expected to run this macro,
4021 # just rely on AC_PROG_CC.
4022 AC_DEFUN([_AM_DEPENDENCIES],
4023 [AC_REQUIRE([AM_SET_DEPDIR])dnl
4024 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
4025 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
4026 AC_REQUIRE([AM_DEP_TRACK])dnl
4027
4028 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
4029 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
4030 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
4031 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
4032 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
4033 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
4034 [depcc="$$1" am_compiler_list=])
4035
4036 AC_CACHE_CHECK([dependency style of $depcc],
4037 [am_cv_$1_dependencies_compiler_type],
4038 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
4039 # We make a subdir and do the tests there. Otherwise we can end up
4040 # making bogus files that we don't know about and never remove. For
4041 # instance it was reported that on HP-UX the gcc test will end up
4042 # making a dummy file named 'D' -- because '-MD' means "put the output
4043 # in D".
4044 rm -rf conftest.dir
4045 mkdir conftest.dir
4046 # Copy depcomp to subdir because otherwise we won't find it if we're
4047 # using a relative directory.
4048 cp "$am_depcomp" conftest.dir
4049 cd conftest.dir
4050 # We will build objects and dependencies in a subdirectory because
4051 # it helps to detect inapplicable dependency modes. For instance
4052 # both Tru64's cc and ICC support -MD to output dependencies as a
4053 # side effect of compilation, but ICC will put the dependencies in
4054 # the current directory while Tru64 will put them in the object
4055 # directory.
4056 mkdir sub
4057
4058 am_cv_$1_dependencies_compiler_type=none
4059 if test "$am_compiler_list" = ""; then
4060 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
4061 fi
4062 am__universal=false
4063 m4_case([$1], [CC],
4064 [case " $depcc " in #(
4065 *\ -arch\ *\ -arch\ *) am__universal=true ;;
4066 esac],
4067 [CXX],
4068 [case " $depcc " in #(
4069 *\ -arch\ *\ -arch\ *) am__universal=true ;;
4070 esac])
4071
4072 for depmode in $am_compiler_list; do
4073 # Setup a source with many dependencies, because some compilers
4074 # like to wrap large dependency lists on column 80 (with \), and
4075 # we should not choose a depcomp mode which is confused by this.
4076 #
4077 # We need to recreate these files for each test, as the compiler may
4078 # overwrite some of them when testing with obscure command lines.
4079 # This happens at least with the AIX C compiler.
4080 : > sub/conftest.c
4081 for i in 1 2 3 4 5 6; do
4082 echo '#include "conftst'$i'.h"' >> sub/conftest.c
4083 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
4084 # Solaris 10 /bin/sh.
4085 echo '/* dummy */' > sub/conftst$i.h
4086 done
4087 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
4088
4089 # We check with '-c' and '-o' for the sake of the "dashmstdout"
4090 # mode. It turns out that the SunPro C++ compiler does not properly
4091 # handle '-M -o', and we need to detect this. Also, some Intel
4092 # versions had trouble with output in subdirs.
4093 am__obj=sub/conftest.${OBJEXT-o}
4094 am__minus_obj="-o $am__obj"
4095 case $depmode in
4096 gcc)
4097 # This depmode causes a compiler race in universal mode.
4098 test "$am__universal" = false || continue
4099 ;;
4100 nosideeffect)
4101 # After this tag, mechanisms are not by side-effect, so they'll
4102 # only be used when explicitly requested.
4103 if test "x$enable_dependency_tracking" = xyes; then
4104 continue
4105 else
4106 break
4107 fi
4108 ;;
4109 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
4110 # This compiler won't grok '-c -o', but also, the minuso test has
4111 # not run yet. These depmodes are late enough in the game, and
4112 # so weak that their functioning should not be impacted.
4113 am__obj=conftest.${OBJEXT-o}
4114 am__minus_obj=
4115 ;;
4116 none) break ;;
4117 esac
4118 if depmode=$depmode \
4119 source=sub/conftest.c object=$am__obj \
4120 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
4121 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
4122 >/dev/null 2>conftest.err &&
4123 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
4124 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
4125 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
4126 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
4127 # icc doesn't choke on unknown options, it will just issue warnings
4128 # or remarks (even with -Werror). So we grep stderr for any message
4129 # that says an option was ignored or not supported.
4130 # When given -MP, icc 7.0 and 7.1 complain thusly:
4131 # icc: Command line warning: ignoring option '-M'; no argument required
4132 # The diagnosis changed in icc 8.0:
4133 # icc: Command line remark: option '-MP' not supported
4134 if (grep 'ignoring option' conftest.err ||
4135 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
4136 am_cv_$1_dependencies_compiler_type=$depmode
4137 break
4138 fi
4139 fi
4140 done
4141
4142 cd ..
4143 rm -rf conftest.dir
4144 else
4145 am_cv_$1_dependencies_compiler_type=none
4146 fi
4147 ])
4148 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
4149 AM_CONDITIONAL([am__fastdep$1], [
4150 test "x$enable_dependency_tracking" != xno \
4151 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
4152 ])
4153
4154
4155 # AM_SET_DEPDIR
4156 # -------------
4157 # Choose a directory name for dependency files.
4158 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
4159 AC_DEFUN([AM_SET_DEPDIR],
4160 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
4161 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
4162 ])
4163
4164
4165 # AM_DEP_TRACK
4166 # ------------
4167 AC_DEFUN([AM_DEP_TRACK],
4168 [AC_ARG_ENABLE([dependency-tracking], [dnl
4169 AS_HELP_STRING(
4170 [--enable-dependency-tracking],
4171 [do not reject slow dependency extractors])
4172 AS_HELP_STRING(
4173 [--disable-dependency-tracking],
4174 [speeds up one-time build])])
4175 if test "x$enable_dependency_tracking" != xno; then
4176 am_depcomp="$ac_aux_dir/depcomp"
4177 AMDEPBACKSLASH='\'
4178 am__nodep='_no'
4179 fi
4180 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
4181 AC_SUBST([AMDEPBACKSLASH])dnl
4182 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
4183 AC_SUBST([am__nodep])dnl
4184 _AM_SUBST_NOTMAKE([am__nodep])dnl
4185 ])
4186
4187 # Generate code to set up dependency tracking. -*- Autoconf -*-
4188
4189 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
4190 #
4191 # This file is free software; the Free Software Foundation
4192 # gives unlimited permission to copy and/or distribute it,
4193 # with or without modifications, as long as this notice is preserved.
4194
4195 # _AM_OUTPUT_DEPENDENCY_COMMANDS
4196 # ------------------------------
4197 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
4198 [{
4199 # Older Autoconf quotes --file arguments for eval, but not when files
4200 # are listed without --file. Let's play safe and only enable the eval
4201 # if we detect the quoting.
4202 # TODO: see whether this extra hack can be removed once we start
4203 # requiring Autoconf 2.70 or later.
4204 AS_CASE([$CONFIG_FILES],
4205 [*\'*], [eval set x "$CONFIG_FILES"],
4206 [*], [set x $CONFIG_FILES])
4207 shift
4208 # Used to flag and report bootstrapping failures.
4209 am_rc=0
4210 for am_mf
4211 do
4212 # Strip MF so we end up with the name of the file.
4213 am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
4214 # Check whether this is an Automake generated Makefile which includes
4215 # dependency-tracking related rules and includes.
4216 # Grep'ing the whole file directly is not great: AIX grep has a line
4217 # limit of 2048, but all sed's we know have understand at least 4000.
4218 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
4219 || continue
4220 am_dirpart=`AS_DIRNAME(["$am_mf"])`
4221 am_filepart=`AS_BASENAME(["$am_mf"])`
4222 AM_RUN_LOG([cd "$am_dirpart" \
4223 && sed -e '/# am--include-marker/d' "$am_filepart" \
4224 | $MAKE -f - am--depfiles]) || am_rc=$?
4225 done
4226 if test $am_rc -ne 0; then
4227 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
4228 for automatic dependency tracking. Try re-running configure with the
4229 '--disable-dependency-tracking' option to at least be able to build
4230 the package (albeit without support for automatic dependency tracking).])
4231 fi
4232 AS_UNSET([am_dirpart])
4233 AS_UNSET([am_filepart])
4234 AS_UNSET([am_mf])
4235 AS_UNSET([am_rc])
4236 rm -f conftest-deps.mk
4237 }
4238 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
4239
4240
4241 # AM_OUTPUT_DEPENDENCY_COMMANDS
4242 # -----------------------------
4243 # This macro should only be invoked once -- use via AC_REQUIRE.
4244 #
4245 # This code is only required when automatic dependency tracking is enabled.
4246 # This creates each '.Po' and '.Plo' makefile fragment that we'll need in
4247 # order to bootstrap the dependency handling code.
4248 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4249 [AC_CONFIG_COMMANDS([depfiles],
4250 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4251 [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
4252
4253 # Do all the work for Automake. -*- Autoconf -*-
4254
4255 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
4256 #
4257 # This file is free software; the Free Software Foundation
4258 # gives unlimited permission to copy and/or distribute it,
4259 # with or without modifications, as long as this notice is preserved.
4260
4261 # This macro actually does too much. Some checks are only needed if
4262 # your package does certain things. But this isn't really a big deal.
4263
4264 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4265 m4_define([AC_PROG_CC],
4266 m4_defn([AC_PROG_CC])
4267 [_AM_PROG_CC_C_O
4268 ])
4269
4270 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4271 # AM_INIT_AUTOMAKE([OPTIONS])
4272 # -----------------------------------------------
4273 # The call with PACKAGE and VERSION arguments is the old style
4274 # call (pre autoconf-2.50), which is being phased out. PACKAGE
4275 # and VERSION should now be passed to AC_INIT and removed from
4276 # the call to AM_INIT_AUTOMAKE.
4277 # We support both call styles for the transition. After
4278 # the next Automake release, Autoconf can make the AC_INIT
4279 # arguments mandatory, and then we can depend on a new Autoconf
4280 # release and drop the old call support.
4281 AC_DEFUN([AM_INIT_AUTOMAKE],
4282 [AC_PREREQ([2.65])dnl
4283 dnl Autoconf wants to disallow AM_ names. We explicitly allow
4284 dnl the ones we care about.
4285 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4286 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4287 AC_REQUIRE([AC_PROG_INSTALL])dnl
4288 if test "`cd $srcdir && pwd`" != "`pwd`"; then
4289 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4290 # is not polluted with repeated "-I."
4291 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4292 # test to see if srcdir already configured
4293 if test -f $srcdir/config.status; then
4294 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4295 fi
4296 fi
4297
4298 # test whether we have cygpath
4299 if test -z "$CYGPATH_W"; then
4300 if (cygpath --version) >/dev/null 2>/dev/null; then
4301 CYGPATH_W='cygpath -w'
4302 else
4303 CYGPATH_W=echo
4304 fi
4305 fi
4306 AC_SUBST([CYGPATH_W])
4307
4308 # Define the identity of the package.
4309 dnl Distinguish between old-style and new-style calls.
4310 m4_ifval([$2],
4311 [AC_DIAGNOSE([obsolete],
4312 [$0: two- and three-arguments forms are deprecated.])
4313 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4314 AC_SUBST([PACKAGE], [$1])dnl
4315 AC_SUBST([VERSION], [$2])],
4316 [_AM_SET_OPTIONS([$1])dnl
4317 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4318 m4_if(
4319 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
4320 [ok:ok],,
4321 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4322 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4323 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4324
4325 _AM_IF_OPTION([no-define],,
4326 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4327 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4328
4329 # Some tools Automake needs.
4330 AC_REQUIRE([AM_SANITY_CHECK])dnl
4331 AC_REQUIRE([AC_ARG_PROGRAM])dnl
4332 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4333 AM_MISSING_PROG([AUTOCONF], [autoconf])
4334 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4335 AM_MISSING_PROG([AUTOHEADER], [autoheader])
4336 AM_MISSING_PROG([MAKEINFO], [makeinfo])
4337 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4338 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4339 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
4340 # For better backward compatibility. To be removed once Automake 1.9.x
4341 # dies out for good. For more background, see:
4342 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
4343 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
4344 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
4345 # We need awk for the "check" target (and possibly the TAP driver). The
4346 # system "awk" is bad on some platforms.
4347 AC_REQUIRE([AC_PROG_AWK])dnl
4348 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
4349 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
4350 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4351 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4352 [_AM_PROG_TAR([v7])])])
4353 _AM_IF_OPTION([no-dependencies],,
4354 [AC_PROVIDE_IFELSE([AC_PROG_CC],
4355 [_AM_DEPENDENCIES([CC])],
4356 [m4_define([AC_PROG_CC],
4357 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
4358 AC_PROVIDE_IFELSE([AC_PROG_CXX],
4359 [_AM_DEPENDENCIES([CXX])],
4360 [m4_define([AC_PROG_CXX],
4361 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
4362 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
4363 [_AM_DEPENDENCIES([OBJC])],
4364 [m4_define([AC_PROG_OBJC],
4365 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
4366 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
4367 [_AM_DEPENDENCIES([OBJCXX])],
4368 [m4_define([AC_PROG_OBJCXX],
4369 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
4370 ])
4371 AC_REQUIRE([AM_SILENT_RULES])dnl
4372 dnl The testsuite driver may need to know about EXEEXT, so add the
4373 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
4374 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
4375 AC_CONFIG_COMMANDS_PRE(dnl
4376 [m4_provide_if([_AM_COMPILER_EXEEXT],
4377 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
4378
4379 # POSIX will say in a future version that running "rm -f" with no argument
4380 # is OK; and we want to be able to make that assumption in our Makefile
4381 # recipes. So use an aggressive probe to check that the usage we want is
4382 # actually supported "in the wild" to an acceptable degree.
4383 # See automake bug#10828.
4384 # To make any issue more visible, cause the running configure to be aborted
4385 # by default if the 'rm' program in use doesn't match our expectations; the
4386 # user can still override this though.
4387 if rm -f && rm -fr && rm -rf; then : OK; else
4388 cat >&2 <<'END'
4389 Oops!
4390
4391 Your 'rm' program seems unable to run without file operands specified
4392 on the command line, even when the '-f' option is present. This is contrary
4393 to the behaviour of most rm programs out there, and not conforming with
4394 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
4395
4396 Please tell bug-automake@gnu.org about your system, including the value
4397 of your $PATH and any error possibly output before this message. This
4398 can help us improve future automake versions.
4399
4400 END
4401 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
4402 echo 'Configuration will proceed anyway, since you have set the' >&2
4403 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
4404 echo >&2
4405 else
4406 cat >&2 <<'END'
4407 Aborting the configuration process, to ensure you take notice of the issue.
4408
4409 You can download and install GNU coreutils to get an 'rm' implementation
4410 that behaves properly: <https://www.gnu.org/software/coreutils/>.
4411
4412 If you want to complete the configuration process using your problematic
4413 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
4414 to "yes", and re-run configure.
4415
4416 END
4417 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
4418 fi
4419 fi
4420 dnl The trailing newline in this macro's definition is deliberate, for
4421 dnl backward compatibility and to allow trailing 'dnl'-style comments
4422 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
4423 ])
4424
4425 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
4426 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
4427 dnl mangled by Autoconf and run in a shell conditional statement.
4428 m4_define([_AC_COMPILER_EXEEXT],
4429 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
4430
4431 # When config.status generates a header, we must update the stamp-h file.
4432 # This file resides in the same directory as the config header
4433 # that is generated. The stamp files are numbered to have different names.
4434
4435 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4436 # loop where config.status creates the headers, so we can generate
4437 # our stamp files there.
4438 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4439 [# Compute $1's index in $config_headers.
4440 _am_arg=$1
4441 _am_stamp_count=1
4442 for _am_header in $config_headers :; do
4443 case $_am_header in
4444 $_am_arg | $_am_arg:* )
4445 break ;;
4446 * )
4447 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
4448 esac
4449 done
4450 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
4451
4452 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
4453 #
4454 # This file is free software; the Free Software Foundation
4455 # gives unlimited permission to copy and/or distribute it,
4456 # with or without modifications, as long as this notice is preserved.
4457
4458 # AM_PROG_INSTALL_SH
4459 # ------------------
4460 # Define $install_sh.
4461 AC_DEFUN([AM_PROG_INSTALL_SH],
4462 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4463 if test x"${install_sh+set}" != xset; then
4464 case $am_aux_dir in
4465 *\ * | *\ *)
4466 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
4467 *)
4468 install_sh="\${SHELL} $am_aux_dir/install-sh"
4469 esac
4470 fi
4471 AC_SUBST([install_sh])])
4472
4473 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
4474 #
4475 # This file is free software; the Free Software Foundation
4476 # gives unlimited permission to copy and/or distribute it,
4477 # with or without modifications, as long as this notice is preserved.
4478
4479 # Check whether the underlying file-system supports filenames
4480 # with a leading dot. For instance MS-DOS doesn't.
4481 AC_DEFUN([AM_SET_LEADING_DOT],
4482 [rm -rf .tst 2>/dev/null
4483 mkdir .tst 2>/dev/null
4484 if test -d .tst; then
4485 am__leading_dot=.
4486 else
4487 am__leading_dot=_
4488 fi
4489 rmdir .tst 2>/dev/null
4490 AC_SUBST([am__leading_dot])])
4491
4492 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
4493 # From Jim Meyering
4494
4495 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
4496 #
4497 # This file is free software; the Free Software Foundation
4498 # gives unlimited permission to copy and/or distribute it,
4499 # with or without modifications, as long as this notice is preserved.
4500
4501 # AM_MAINTAINER_MODE([DEFAULT-MODE])
4502 # ----------------------------------
4503 # Control maintainer-specific portions of Makefiles.
4504 # Default is to disable them, unless 'enable' is passed literally.
4505 # For symmetry, 'disable' may be passed as well. Anyway, the user
4506 # can override the default with the --enable/--disable switch.
4507 AC_DEFUN([AM_MAINTAINER_MODE],
4508 [m4_case(m4_default([$1], [disable]),
4509 [enable], [m4_define([am_maintainer_other], [disable])],
4510 [disable], [m4_define([am_maintainer_other], [enable])],
4511 [m4_define([am_maintainer_other], [enable])
4512 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
4513 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
4514 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
4515 AC_ARG_ENABLE([maintainer-mode],
4516 [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
4517 am_maintainer_other[ make rules and dependencies not useful
4518 (and sometimes confusing) to the casual installer])],
4519 [USE_MAINTAINER_MODE=$enableval],
4520 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
4521 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
4522 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
4523 MAINT=$MAINTAINER_MODE_TRUE
4524 AC_SUBST([MAINT])dnl
4525 ]
4526 )
4527
4528 # Check to see how 'make' treats includes. -*- Autoconf -*-
4529
4530 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
4531 #
4532 # This file is free software; the Free Software Foundation
4533 # gives unlimited permission to copy and/or distribute it,
4534 # with or without modifications, as long as this notice is preserved.
4535
4536 # AM_MAKE_INCLUDE()
4537 # -----------------
4538 # Check whether make has an 'include' directive that can support all
4539 # the idioms we need for our automatic dependency tracking code.
4540 AC_DEFUN([AM_MAKE_INCLUDE],
4541 [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
4542 cat > confinc.mk << 'END'
4543 am__doit:
4544 @echo this is the am__doit target >confinc.out
4545 .PHONY: am__doit
4546 END
4547 am__include="#"
4548 am__quote=
4549 # BSD make does it like this.
4550 echo '.include "confinc.mk" # ignored' > confmf.BSD
4551 # Other make implementations (GNU, Solaris 10, AIX) do it like this.
4552 echo 'include confinc.mk # ignored' > confmf.GNU
4553 _am_result=no
4554 for s in GNU BSD; do
4555 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
4556 AS_CASE([$?:`cat confinc.out 2>/dev/null`],
4557 ['0:this is the am__doit target'],
4558 [AS_CASE([$s],
4559 [BSD], [am__include='.include' am__quote='"'],
4560 [am__include='include' am__quote=''])])
4561 if test "$am__include" != "#"; then
4562 _am_result="yes ($s style)"
4563 break
4564 fi
4565 done
4566 rm -f confinc.* confmf.*
4567 AC_MSG_RESULT([${_am_result}])
4568 AC_SUBST([am__include])])
4569 AC_SUBST([am__quote])])
4570
4571 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
4572
4573 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
4574 #
4575 # This file is free software; the Free Software Foundation
4576 # gives unlimited permission to copy and/or distribute it,
4577 # with or without modifications, as long as this notice is preserved.
4578
4579 # AM_MISSING_PROG(NAME, PROGRAM)
4580 # ------------------------------
4581 AC_DEFUN([AM_MISSING_PROG],
4582 [AC_REQUIRE([AM_MISSING_HAS_RUN])
4583 $1=${$1-"${am_missing_run}$2"}
4584 AC_SUBST($1)])
4585
4586 # AM_MISSING_HAS_RUN
4587 # ------------------
4588 # Define MISSING if not defined so far and test if it is modern enough.
4589 # If it is, set am_missing_run to use it, otherwise, to nothing.
4590 AC_DEFUN([AM_MISSING_HAS_RUN],
4591 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4592 AC_REQUIRE_AUX_FILE([missing])dnl
4593 if test x"${MISSING+set}" != xset; then
4594 case $am_aux_dir in
4595 *\ * | *\ *)
4596 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
4597 *)
4598 MISSING="\${SHELL} $am_aux_dir/missing" ;;
4599 esac
4600 fi
4601 # Use eval to expand $SHELL
4602 if eval "$MISSING --is-lightweight"; then
4603 am_missing_run="$MISSING "
4604 else
4605 am_missing_run=
4606 AC_MSG_WARN(['missing' script is too old or missing])
4607 fi
4608 ])
4609
4610 # Helper functions for option handling. -*- Autoconf -*-
4611
4612 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
4613 #
4614 # This file is free software; the Free Software Foundation
4615 # gives unlimited permission to copy and/or distribute it,
4616 # with or without modifications, as long as this notice is preserved.
4617
4618 # _AM_MANGLE_OPTION(NAME)
4619 # -----------------------
4620 AC_DEFUN([_AM_MANGLE_OPTION],
4621 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
4622
4623 # _AM_SET_OPTION(NAME)
4624 # --------------------
4625 # Set option NAME. Presently that only means defining a flag for this option.
4626 AC_DEFUN([_AM_SET_OPTION],
4627 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
4628
4629 # _AM_SET_OPTIONS(OPTIONS)
4630 # ------------------------
4631 # OPTIONS is a space-separated list of Automake options.
4632 AC_DEFUN([_AM_SET_OPTIONS],
4633 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
4634
4635 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
4636 # -------------------------------------------
4637 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
4638 AC_DEFUN([_AM_IF_OPTION],
4639 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
4640
4641 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
4642 #
4643 # This file is free software; the Free Software Foundation
4644 # gives unlimited permission to copy and/or distribute it,
4645 # with or without modifications, as long as this notice is preserved.
4646
4647 # _AM_PROG_CC_C_O
4648 # ---------------
4649 # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
4650 # to automatically call this.
4651 AC_DEFUN([_AM_PROG_CC_C_O],
4652 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4653 AC_REQUIRE_AUX_FILE([compile])dnl
4654 AC_LANG_PUSH([C])dnl
4655 AC_CACHE_CHECK(
4656 [whether $CC understands -c and -o together],
4657 [am_cv_prog_cc_c_o],
4658 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
4659 # Make sure it works both with $CC and with simple cc.
4660 # Following AC_PROG_CC_C_O, we do the test twice because some
4661 # compilers refuse to overwrite an existing .o file with -o,
4662 # though they will create one.
4663 am_cv_prog_cc_c_o=yes
4664 for am_i in 1 2; do
4665 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
4666 && test -f conftest2.$ac_objext; then
4667 : OK
4668 else
4669 am_cv_prog_cc_c_o=no
4670 break
4671 fi
4672 done
4673 rm -f core conftest*
4674 unset am_i])
4675 if test "$am_cv_prog_cc_c_o" != yes; then
4676 # Losing compiler, so override with the script.
4677 # FIXME: It is wrong to rewrite CC.
4678 # But if we don't then we get into trouble of one sort or another.
4679 # A longer-term fix would be to have automake use am__CC in this case,
4680 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
4681 CC="$am_aux_dir/compile $CC"
4682 fi
4683 AC_LANG_POP([C])])
4684
4685 # For backward compatibility.
4686 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
4687
4688 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
4689 #
4690 # This file is free software; the Free Software Foundation
4691 # gives unlimited permission to copy and/or distribute it,
4692 # with or without modifications, as long as this notice is preserved.
4693
4694
4695 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4696 # ---------------------------------------------------------------------------
4697 # Adds support for distributing Python modules and packages. To
4698 # install modules, copy them to $(pythondir), using the python_PYTHON
4699 # automake variable. To install a package with the same name as the
4700 # automake package, install to $(pkgpythondir), or use the
4701 # pkgpython_PYTHON automake variable.
4702 #
4703 # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
4704 # locations to install python extension modules (shared libraries).
4705 # Another macro is required to find the appropriate flags to compile
4706 # extension modules.
4707 #
4708 # If your package is configured with a different prefix to python,
4709 # users will have to add the install directory to the PYTHONPATH
4710 # environment variable, or create a .pth file (see the python
4711 # documentation for details).
4712 #
4713 # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
4714 # cause an error if the version of python installed on the system
4715 # doesn't meet the requirement. MINIMUM-VERSION should consist of
4716 # numbers and dots only.
4717 AC_DEFUN([AM_PATH_PYTHON],
4718 [
4719 dnl Find a Python interpreter. Python versions prior to 2.0 are not
4720 dnl supported. (2.0 was released on October 16, 2000).
4721 m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
4722 [python python2 python3 dnl
4723 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl
4724 python3.2 python3.1 python3.0 dnl
4725 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl
4726 python2.0])
4727
4728 AC_ARG_VAR([PYTHON], [the Python interpreter])
4729
4730 m4_if([$1],[],[
4731 dnl No version check is needed.
4732 # Find any Python interpreter.
4733 if test -z "$PYTHON"; then
4734 AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
4735 fi
4736 am_display_PYTHON=python
4737 ], [
4738 dnl A version check is needed.
4739 if test -n "$PYTHON"; then
4740 # If the user set $PYTHON, use it and don't search something else.
4741 AC_MSG_CHECKING([whether $PYTHON version is >= $1])
4742 AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
4743 [AC_MSG_RESULT([yes])],
4744 [AC_MSG_RESULT([no])
4745 AC_MSG_ERROR([Python interpreter is too old])])
4746 am_display_PYTHON=$PYTHON
4747 else
4748 # Otherwise, try each interpreter until we find one that satisfies
4749 # VERSION.
4750 AC_CACHE_CHECK([for a Python interpreter with version >= $1],
4751 [am_cv_pathless_PYTHON],[
4752 for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
4753 test "$am_cv_pathless_PYTHON" = none && break
4754 AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
4755 done])
4756 # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
4757 if test "$am_cv_pathless_PYTHON" = none; then
4758 PYTHON=:
4759 else
4760 AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
4761 fi
4762 am_display_PYTHON=$am_cv_pathless_PYTHON
4763 fi
4764 ])
4765
4766 if test "$PYTHON" = :; then
4767 dnl Run any user-specified action, or abort.
4768 m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
4769 else
4770
4771 dnl Query Python for its version number. Getting [:3] seems to be
4772 dnl the best way to do this; it's what "site.py" does in the standard
4773 dnl library.
4774
4775 AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
4776 [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
4777 AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
4778
4779 dnl Use the values of $prefix and $exec_prefix for the corresponding
4780 dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
4781 dnl distinct variables so they can be overridden if need be. However,
4782 dnl general consensus is that you shouldn't need this ability.
4783
4784 AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
4785 AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
4786
4787 dnl At times (like when building shared libraries) you may want
4788 dnl to know which OS platform Python thinks this is.
4789
4790 AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
4791 [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
4792 AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
4793
4794 # Just factor out some code duplication.
4795 am_python_setup_sysconfig="\
4796 import sys
4797 # Prefer sysconfig over distutils.sysconfig, for better compatibility
4798 # with python 3.x. See automake bug#10227.
4799 try:
4800 import sysconfig
4801 except ImportError:
4802 can_use_sysconfig = 0
4803 else:
4804 can_use_sysconfig = 1
4805 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
4806 # <https://github.com/pypa/virtualenv/issues/118>
4807 try:
4808 from platform import python_implementation
4809 if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
4810 can_use_sysconfig = 0
4811 except ImportError:
4812 pass"
4813
4814 dnl Set up 4 directories:
4815
4816 dnl pythondir -- where to install python scripts. This is the
4817 dnl site-packages directory, not the python standard library
4818 dnl directory like in previous automake betas. This behavior
4819 dnl is more consistent with lispdir.m4 for example.
4820 dnl Query distutils for this directory.
4821 AC_CACHE_CHECK([for $am_display_PYTHON script directory],
4822 [am_cv_python_pythondir],
4823 [if test "x$prefix" = xNONE
4824 then
4825 am_py_prefix=$ac_default_prefix
4826 else
4827 am_py_prefix=$prefix
4828 fi
4829 am_cv_python_pythondir=`$PYTHON -c "
4830 $am_python_setup_sysconfig
4831 if can_use_sysconfig:
4832 sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
4833 else:
4834 from distutils import sysconfig
4835 sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
4836 sys.stdout.write(sitedir)"`
4837 case $am_cv_python_pythondir in
4838 $am_py_prefix*)
4839 am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
4840 am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
4841 ;;
4842 *)
4843 case $am_py_prefix in
4844 /usr|/System*) ;;
4845 *)
4846 am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
4847 ;;
4848 esac
4849 ;;
4850 esac
4851 ])
4852 AC_SUBST([pythondir], [$am_cv_python_pythondir])
4853
4854 dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
4855 dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
4856 dnl more consistent with the rest of automake.
4857
4858 AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
4859
4860 dnl pyexecdir -- directory for installing python extension modules
4861 dnl (shared libraries)
4862 dnl Query distutils for this directory.
4863 AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
4864 [am_cv_python_pyexecdir],
4865 [if test "x$exec_prefix" = xNONE
4866 then
4867 am_py_exec_prefix=$am_py_prefix
4868 else
4869 am_py_exec_prefix=$exec_prefix
4870 fi
4871 am_cv_python_pyexecdir=`$PYTHON -c "
4872 $am_python_setup_sysconfig
4873 if can_use_sysconfig:
4874 sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
4875 else:
4876 from distutils import sysconfig
4877 sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
4878 sys.stdout.write(sitedir)"`
4879 case $am_cv_python_pyexecdir in
4880 $am_py_exec_prefix*)
4881 am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
4882 am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
4883 ;;
4884 *)
4885 case $am_py_exec_prefix in
4886 /usr|/System*) ;;
4887 *)
4888 am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
4889 ;;
4890 esac
4891 ;;
4892 esac
4893 ])
4894 AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
4895
4896 dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
4897
4898 AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
4899
4900 dnl Run any user-specified action.
4901 $2
4902 fi
4903
4904 ])
4905
4906
4907 # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
4908 # ---------------------------------------------------------------------------
4909 # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
4910 # Run ACTION-IF-FALSE otherwise.
4911 # This test uses sys.hexversion instead of the string equivalent (first
4912 # word of sys.version), in order to cope with versions such as 2.2c1.
4913 # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
4914 AC_DEFUN([AM_PYTHON_CHECK_VERSION],
4915 [prog="import sys
4916 # split strings by '.' and convert to numeric. Append some zeros
4917 # because we need at least 4 digits for the hex conversion.
4918 # map returns an iterator in Python 3.0 and a list in 2.x
4919 minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
4920 minverhex = 0
4921 # xrange is not present in Python 3.0 and range returns an iterator
4922 for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
4923 sys.exit(sys.hexversion < minverhex)"
4924 AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
4925
4926 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
4927 #
4928 # This file is free software; the Free Software Foundation
4929 # gives unlimited permission to copy and/or distribute it,
4930 # with or without modifications, as long as this notice is preserved.
4931
4932 # AM_RUN_LOG(COMMAND)
4933 # -------------------
4934 # Run COMMAND, save the exit status in ac_status, and log it.
4935 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
4936 AC_DEFUN([AM_RUN_LOG],
4937 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
4938 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
4939 ac_status=$?
4940 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
4941 (exit $ac_status); }])
4942
4943 # Check to make sure that the build environment is sane. -*- Autoconf -*-
4944
4945 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
4946 #
4947 # This file is free software; the Free Software Foundation
4948 # gives unlimited permission to copy and/or distribute it,
4949 # with or without modifications, as long as this notice is preserved.
4950
4951 # AM_SANITY_CHECK
4952 # ---------------
4953 AC_DEFUN([AM_SANITY_CHECK],
4954 [AC_MSG_CHECKING([whether build environment is sane])
4955 # Reject unsafe characters in $srcdir or the absolute working directory
4956 # name. Accept space and tab only in the latter.
4957 am_lf='
4958 '
4959 case `pwd` in
4960 *[[\\\"\#\$\&\'\`$am_lf]]*)
4961 AC_MSG_ERROR([unsafe absolute working directory name]);;
4962 esac
4963 case $srcdir in
4964 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
4965 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
4966 esac
4967
4968 # Do 'set' in a subshell so we don't clobber the current shell's
4969 # arguments. Must try -L first in case configure is actually a
4970 # symlink; some systems play weird games with the mod time of symlinks
4971 # (eg FreeBSD returns the mod time of the symlink's containing
4972 # directory).
4973 if (
4974 am_has_slept=no
4975 for am_try in 1 2; do
4976 echo "timestamp, slept: $am_has_slept" > conftest.file
4977 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
4978 if test "$[*]" = "X"; then
4979 # -L didn't work.
4980 set X `ls -t "$srcdir/configure" conftest.file`
4981 fi
4982 if test "$[*]" != "X $srcdir/configure conftest.file" \
4983 && test "$[*]" != "X conftest.file $srcdir/configure"; then
4984
4985 # If neither matched, then we have a broken ls. This can happen
4986 # if, for instance, CONFIG_SHELL is bash and it inherits a
4987 # broken ls alias from the environment. This has actually
4988 # happened. Such a system could not be considered "sane".
4989 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
4990 alias in your environment])
4991 fi
4992 if test "$[2]" = conftest.file || test $am_try -eq 2; then
4993 break
4994 fi
4995 # Just in case.
4996 sleep 1
4997 am_has_slept=yes
4998 done
4999 test "$[2]" = conftest.file
5000 )
5001 then
5002 # Ok.
5003 :
5004 else
5005 AC_MSG_ERROR([newly created file is older than distributed files!
5006 Check your system clock])
5007 fi
5008 AC_MSG_RESULT([yes])
5009 # If we didn't sleep, we still need to ensure time stamps of config.status and
5010 # generated files are strictly newer.
5011 am_sleep_pid=
5012 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
5013 ( sleep 1 ) &
5014 am_sleep_pid=$!
5015 fi
5016 AC_CONFIG_COMMANDS_PRE(
5017 [AC_MSG_CHECKING([that generated files are newer than configure])
5018 if test -n "$am_sleep_pid"; then
5019 # Hide warnings about reused PIDs.
5020 wait $am_sleep_pid 2>/dev/null
5021 fi
5022 AC_MSG_RESULT([done])])
5023 rm -f conftest.file
5024 ])
5025
5026 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
5027 #
5028 # This file is free software; the Free Software Foundation
5029 # gives unlimited permission to copy and/or distribute it,
5030 # with or without modifications, as long as this notice is preserved.
5031
5032 # AM_SILENT_RULES([DEFAULT])
5033 # --------------------------
5034 # Enable less verbose build rules; with the default set to DEFAULT
5035 # ("yes" being less verbose, "no" or empty being verbose).
5036 AC_DEFUN([AM_SILENT_RULES],
5037 [AC_ARG_ENABLE([silent-rules], [dnl
5038 AS_HELP_STRING(
5039 [--enable-silent-rules],
5040 [less verbose build output (undo: "make V=1")])
5041 AS_HELP_STRING(
5042 [--disable-silent-rules],
5043 [verbose build output (undo: "make V=0")])dnl
5044 ])
5045 case $enable_silent_rules in @%:@ (((
5046 yes) AM_DEFAULT_VERBOSITY=0;;
5047 no) AM_DEFAULT_VERBOSITY=1;;
5048 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
5049 esac
5050 dnl
5051 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
5052 dnl do not support nested variable expansions.
5053 dnl See automake bug#9928 and bug#10237.
5054 am_make=${MAKE-make}
5055 AC_CACHE_CHECK([whether $am_make supports nested variables],
5056 [am_cv_make_support_nested_variables],
5057 [if AS_ECHO([['TRUE=$(BAR$(V))
5058 BAR0=false
5059 BAR1=true
5060 V=1
5061 am__doit:
5062 @$(TRUE)
5063 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
5064 am_cv_make_support_nested_variables=yes
5065 else
5066 am_cv_make_support_nested_variables=no
5067 fi])
5068 if test $am_cv_make_support_nested_variables = yes; then
5069 dnl Using '$V' instead of '$(V)' breaks IRIX make.
5070 AM_V='$(V)'
5071 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
5072 else
5073 AM_V=$AM_DEFAULT_VERBOSITY
5074 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
5075 fi
5076 AC_SUBST([AM_V])dnl
5077 AM_SUBST_NOTMAKE([AM_V])dnl
5078 AC_SUBST([AM_DEFAULT_V])dnl
5079 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
5080 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
5081 AM_BACKSLASH='\'
5082 AC_SUBST([AM_BACKSLASH])dnl
5083 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
5084 ])
5085
5086 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
5087 #
5088 # This file is free software; the Free Software Foundation
5089 # gives unlimited permission to copy and/or distribute it,
5090 # with or without modifications, as long as this notice is preserved.
5091
5092 # AM_PROG_INSTALL_STRIP
5093 # ---------------------
5094 # One issue with vendor 'install' (even GNU) is that you can't
5095 # specify the program used to strip binaries. This is especially
5096 # annoying in cross-compiling environments, where the build's strip
5097 # is unlikely to handle the host's binaries.
5098 # Fortunately install-sh will honor a STRIPPROG variable, so we
5099 # always use install-sh in "make install-strip", and initialize
5100 # STRIPPROG with the value of the STRIP variable (set by the user).
5101 AC_DEFUN([AM_PROG_INSTALL_STRIP],
5102 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
5103 # Installed binaries are usually stripped using 'strip' when the user
5104 # run "make install-strip". However 'strip' might not be the right
5105 # tool to use in cross-compilation environments, therefore Automake
5106 # will honor the 'STRIP' environment variable to overrule this program.
5107 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
5108 if test "$cross_compiling" != no; then
5109 AC_CHECK_TOOL([STRIP], [strip], :)
5110 fi
5111 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
5112 AC_SUBST([INSTALL_STRIP_PROGRAM])])
5113
5114 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
5115 #
5116 # This file is free software; the Free Software Foundation
5117 # gives unlimited permission to copy and/or distribute it,
5118 # with or without modifications, as long as this notice is preserved.
5119
5120 # _AM_SUBST_NOTMAKE(VARIABLE)
5121 # ---------------------------
5122 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
5123 # This macro is traced by Automake.
5124 AC_DEFUN([_AM_SUBST_NOTMAKE])
5125
5126 # AM_SUBST_NOTMAKE(VARIABLE)
5127 # --------------------------
5128 # Public sister of _AM_SUBST_NOTMAKE.
5129 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
5130
5131 # Check how to create a tarball. -*- Autoconf -*-
5132
5133 # Copyright (C) 2004-2018 Free Software Foundation, Inc.
5134 #
5135 # This file is free software; the Free Software Foundation
5136 # gives unlimited permission to copy and/or distribute it,
5137 # with or without modifications, as long as this notice is preserved.
5138
5139 # _AM_PROG_TAR(FORMAT)
5140 # --------------------
5141 # Check how to create a tarball in format FORMAT.
5142 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
5143 #
5144 # Substitute a variable $(am__tar) that is a command
5145 # writing to stdout a FORMAT-tarball containing the directory
5146 # $tardir.
5147 # tardir=directory && $(am__tar) > result.tar
5148 #
5149 # Substitute a variable $(am__untar) that extract such
5150 # a tarball read from stdin.
5151 # $(am__untar) < result.tar
5152 #
5153 AC_DEFUN([_AM_PROG_TAR],
5154 [# Always define AMTAR for backward compatibility. Yes, it's still used
5155 # in the wild :-( We should find a proper way to deprecate it ...
5156 AC_SUBST([AMTAR], ['$${TAR-tar}'])
5157
5158 # We'll loop over all known methods to create a tar archive until one works.
5159 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
5160
5161 m4_if([$1], [v7],
5162 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
5163
5164 [m4_case([$1],
5165 [ustar],
5166 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
5167 # There is notably a 21 bits limit for the UID and the GID. In fact,
5168 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
5169 # and bug#13588).
5170 am_max_uid=2097151 # 2^21 - 1
5171 am_max_gid=$am_max_uid
5172 # The $UID and $GID variables are not portable, so we need to resort
5173 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
5174 # below are definitely unexpected, so allow the users to see them
5175 # (that is, avoid stderr redirection).
5176 am_uid=`id -u || echo unknown`
5177 am_gid=`id -g || echo unknown`
5178 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
5179 if test $am_uid -le $am_max_uid; then
5180 AC_MSG_RESULT([yes])
5181 else
5182 AC_MSG_RESULT([no])
5183 _am_tools=none
5184 fi
5185 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
5186 if test $am_gid -le $am_max_gid; then
5187 AC_MSG_RESULT([yes])
5188 else
5189 AC_MSG_RESULT([no])
5190 _am_tools=none
5191 fi],
5192
5193 [pax],
5194 [],
5195
5196 [m4_fatal([Unknown tar format])])
5197
5198 AC_MSG_CHECKING([how to create a $1 tar archive])
5199
5200 # Go ahead even if we have the value already cached. We do so because we
5201 # need to set the values for the 'am__tar' and 'am__untar' variables.
5202 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
5203
5204 for _am_tool in $_am_tools; do
5205 case $_am_tool in
5206 gnutar)
5207 for _am_tar in tar gnutar gtar; do
5208 AM_RUN_LOG([$_am_tar --version]) && break
5209 done
5210 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
5211 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
5212 am__untar="$_am_tar -xf -"
5213 ;;
5214 plaintar)
5215 # Must skip GNU tar: if it does not support --format= it doesn't create
5216 # ustar tarball either.
5217 (tar --version) >/dev/null 2>&1 && continue
5218 am__tar='tar chf - "$$tardir"'
5219 am__tar_='tar chf - "$tardir"'
5220 am__untar='tar xf -'
5221 ;;
5222 pax)
5223 am__tar='pax -L -x $1 -w "$$tardir"'
5224 am__tar_='pax -L -x $1 -w "$tardir"'
5225 am__untar='pax -r'
5226 ;;
5227 cpio)
5228 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
5229 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
5230 am__untar='cpio -i -H $1 -d'
5231 ;;
5232 none)
5233 am__tar=false
5234 am__tar_=false
5235 am__untar=false
5236 ;;
5237 esac
5238
5239 # If the value was cached, stop now. We just wanted to have am__tar
5240 # and am__untar set.
5241 test -n "${am_cv_prog_tar_$1}" && break
5242
5243 # tar/untar a dummy directory, and stop if the command works.
5244 rm -rf conftest.dir
5245 mkdir conftest.dir
5246 echo GrepMe > conftest.dir/file
5247 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
5248 rm -rf conftest.dir
5249 if test -s conftest.tar; then
5250 AM_RUN_LOG([$am__untar <conftest.tar])
5251 AM_RUN_LOG([cat conftest.dir/file])
5252 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
5253 fi
5254 done
5255 rm -rf conftest.dir
5256
5257 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
5258 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
5259
5260 AC_SUBST([am__tar])
5261 AC_SUBST([am__untar])
5262 ]) # _AM_PROG_TAR
5263
This page took 0.264566 seconds and 5 git commands to generate.