/
general.m4
3374 lines (2891 loc) · 113 KB
/
general.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is part of Autoconf. -*- Autoconf -*-
# Parameterized macros.
m4_define([_AC_COPYRIGHT_YEARS], [
Copyright (C) 1992-1996, 1998-2017, 2020-2024 Free Software Foundation,
Inc.
])
# This file is part of Autoconf. This program is free
# software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the Autoconf Configure Script Exception,
# version 3.0, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License
# and a copy of the Autoconf Configure Script Exception along with
# this program; see the files COPYINGv3 and COPYING.EXCEPTION
# respectively. If not, see <https://www.gnu.org/licenses/>.
# Written by David MacKenzie, with help from
# François Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
## ---------------- ##
## The diversions. ##
## ---------------- ##
# We heavily use m4's diversions both for the initializations and for
# required macros (see AC_REQUIRE), because in both cases we have to
# issue high in 'configure' something which is discovered late.
#
# KILL is only used to suppress output.
#
# The layers of 'configure'. We let m4 undivert them by itself, when
# it reaches the end of 'configure.ac'.
#
# - BINSH
# #! /bin/sh
# - HEADER-REVISION
# Sent by AC_REVISION
# - HEADER-COMMENT
# Purpose of the script.
# - HEADER-COPYRIGHT
# Copyright notice(s)
# - M4SH-INIT
# Initialization of bottom layers.
#
# - DEFAULTS
# early initializations (defaults)
# - PARSE_ARGS
# initialization code, option handling loop.
#
# - HELP_BEGIN
# Handling 'configure --help'.
# - HELP_CANON
# Help msg for AC_CANONICAL_*
# - HELP_ENABLE
# Help msg from AC_ARG_ENABLE.
# - HELP_WITH
# Help msg from AC_ARG_WITH.
# - HELP_VAR
# Help msg from AC_ARG_VAR.
# - HELP_VAR_END
# A small paragraph on the use of the variables.
# - HELP_END
# Tail of the handling of --help.
#
# - VERSION_BEGIN
# Head of the handling of --version.
# - VERSION_FSF
# FSF copyright notice for --version.
# - VERSION_USER
# User copyright notice for --version.
# - VERSION_END
# Tail of the handling of --version.
#
# - SHELL_FN
# Shell functions.
#
# - INIT_PREPARE
# Tail of initialization code.
#
# - BODY
# the tests and output code
#
# _m4_divert(DIVERSION-NAME)
# --------------------------
# Convert a diversion name into its number. Otherwise, return
# DIVERSION-NAME which is supposed to be an actual diversion number.
# Of course it would be nicer to use m4_case here, instead of zillions
# of little macros, but it then takes twice longer to run 'autoconf'!
#
# From M4sugar:
# -1. KILL
# 10000. GROW
#
# From M4sh:
# 0. BINSH
# 1. HEADER-REVISION
# 2. HEADER-COMMENT
# 3. HEADER-COPYRIGHT
# 4. M4SH-INIT
# 1000. BODY
m4_define([_m4_divert(DEFAULTS)], 10)
m4_define([_m4_divert(PARSE_ARGS)], 20)
m4_define([_m4_divert(HELP_BEGIN)], 100)
m4_define([_m4_divert(HELP_CANON)], 101)
m4_define([_m4_divert(HELP_ENABLE)], 102)
m4_define([_m4_divert(HELP_WITH)], 103)
m4_define([_m4_divert(HELP_VAR)], 104)
m4_define([_m4_divert(HELP_VAR_END)], 105)
m4_define([_m4_divert(HELP_END)], 106)
m4_define([_m4_divert(VERSION_BEGIN)], 200)
m4_define([_m4_divert(VERSION_FSF)], 201)
m4_define([_m4_divert(VERSION_USER)], 202)
m4_define([_m4_divert(VERSION_END)], 203)
m4_define([_m4_divert(SHELL_FN)], 250)
m4_define([_m4_divert(INIT_PREPARE)], 300)
# AC_DIVERT_PUSH(DIVERSION-NAME)
# AC_DIVERT_POP
# ------------------------------
m4_copy([m4_divert_push],[AC_DIVERT_PUSH])
m4_copy([m4_divert_pop], [AC_DIVERT_POP])
## ------------------------------------ ##
## Defining/requiring Autoconf macros. ##
## ------------------------------------ ##
# AC_DEFUN(NAME, EXPANSION)
# AC_DEFUN_ONCE(NAME, EXPANSION)
# AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
# AC_REQUIRE(STRING)
# AC_PROVIDE(MACRO-NAME)
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
# -----------------------------------------------------------
m4_copy([m4_defun], [AC_DEFUN])
m4_copy([m4_defun_once], [AC_DEFUN_ONCE])
m4_copy([m4_before], [AC_BEFORE])
m4_copy([m4_require], [AC_REQUIRE])
m4_copy([m4_provide], [AC_PROVIDE])
m4_copy([m4_provide_if], [AC_PROVIDE_IFELSE])
## ----------------------------- ##
## Implementing shell functions. ##
## ----------------------------- ##
# AC_REQUIRE_SHELL_FN(NAME-TO-CHECK, COMMENT, BODY, [DIVERSION = SHELL_FN]
# ------------------------------------------------------------------------
# Same as AS_REQUIRE_SHELL_FN except that the default diversion comes
# later in the script (speeding up configure --help and --version).
AC_DEFUN([AC_REQUIRE_SHELL_FN],
[AS_REQUIRE_SHELL_FN([$1], [$2], [$3], m4_default_quoted([$4], [SHELL_FN]))])
## ----------------------------- ##
## Implementing Autoconf loops. ##
## ----------------------------- ##
# AU::AC_FOREACH(VARIABLE, LIST, EXPRESSION)
# ------------------------------------------
# The double definition is necessary because autoupdate expands m4_
# macros, so we have to double-quote the replacement, but then it
# won't work in a normal autoconf run.
AU_DEFUN([AC_FOREACH], [[m4_foreach_w($@)]])
AC_DEFUN([AC_FOREACH], [m4_foreach_w($@)dnl
m4_warn([obsolete], [The macro 'AC_FOREACH' is obsolete.
You should run autoupdate.])])
## ----------------------------------- ##
## Helping macros to display strings. ##
## ----------------------------------- ##
# AU::AC_HELP_STRING(LHS, RHS, [COLUMN])
# --------------------------------------
AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING])
## ---------------------------------------------- ##
## Information on the package being Autoconf'ed. ##
## ---------------------------------------------- ##
# It is suggested that the macros in this section appear before
# AC_INIT in 'configure.ac'. Nevertheless, this is just stylistic,
# and from the implementation point of view, AC_INIT *must* be expanded
# beforehand: it puts data in diversions which must appear before the
# data provided by the macros of this section.
# The solution is to require AC_INIT in each of these macros. AC_INIT
# has the needed magic so that it can't be expanded twice.
# _AC_INIT_LITERAL(STRING)
# ------------------------
# Reject STRING if it cannot be used as-is in single-quoted strings,
# double-quoted strings, and quoted and unquoted here-docs.
m4_define([_AC_INIT_LITERAL],
[m4_if(m4_index(m4_translit([[$1]], [""], ['']),
['])AS_LITERAL_HEREDOC_IF([$1], [-]),
[-1-], [],
[m4_warn([syntax], [AC_INIT: not a literal: "$1"])])])
# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
# ---------------------------------------------------------------------
# Set the values of AC_PACKAGE_{NAME,VERSION,STRING,BUGREPORT,TARNAME,URL}
# from the arguments.
m4_define([_AC_INIT_PACKAGE],
[_AC_INIT_PACKAGE_N(m4_normalize([$1]), m4_normalize([$2]), m4_normalize([$3]),
m4_normalize([$4]), m4_normalize([$5]))])
# _AC_INIT_PACKAGE_N(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
# -----------------------------------------------------------------------
# Subroutine of _AC_INIT_PACKAGE.
m4_define([_AC_INIT_PACKAGE_N],
[# PACKAGE-NAME, VERSION, BUGREPORT, and URL should all be safe for use
# in shell strings of all kinds.
_AC_INIT_LITERAL([$1])
_AC_INIT_LITERAL([$2])
_AC_INIT_LITERAL([$3])
_AC_INIT_LITERAL([$5])
# TARNAME is even more constrained: it should not contain any shell
# metacharacters or whitespace, because it is used to construct
# filenames.
AS_LITERAL_WORD_IF([$4], [],
[m4_warn([syntax],
[AC_INIT: unsafe as a filename: "$4"])])
m4_define_default([AC_PACKAGE_NAME], [$1])
m4_define_default([AC_PACKAGE_VERSION], [$2])
# The m4_strip makes AC_PACKAGE_STRING be [], not [ ], when
# both $1 and $2 are empty.
m4_define_default([AC_PACKAGE_STRING], m4_strip([$1 $2]))
m4_define_default([AC_PACKAGE_BUGREPORT], [$3])
# N.B. m4_ifnblank strips one layer of quotation from whichever of its
# second and third argument it evaluates to.
m4_define_default([AC_PACKAGE_TARNAME],
m4_ifnblank([$4], [[$4]],
[m4_quote(m4_bpatsubst(m4_tolower(m4_bpatsubst([$1], [^GNU ], [])),
[[^_abcdefghijklmnopqrstuvwxyz0123456789]], [-]))]))
m4_define_default([AC_PACKAGE_URL],
m4_ifnblank([$5], [[$5]],
[m4_if(m4_index([$1], [GNU ]), [0],
[[https://www.gnu.org/software/]m4_defn([AC_PACKAGE_TARNAME])[/]],
[])]))
])
# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER],
# [FILTER = m4_newline])
# ------------------------------------------------------
# Emit TEXT, a copyright notice, in the top of 'configure' and in
# --version output. Macros in TEXT are evaluated once. Process
# the --version output through FILTER (m4_newline, m4_do, and
# m4_copyright_condense are common filters).
m4_define([AC_COPYRIGHT],
[AS_COPYRIGHT([$1])[]]dnl
[m4_divert_text(m4_default_quoted([$2], [VERSION_USER]),
[m4_default([$3], [m4_newline])([$1])])])# AC_COPYRIGHT
# AC_REVISION(REVISION-INFO)
# --------------------------
# The second quote in the translit is just to cope with font-lock-mode
# which sees the opening of a string.
m4_define([AC_REVISION],
[m4_divert_text([HEADER-REVISION],
[@%:@ From __file__ m4_translit([$1], [$""]).])dnl
])
## ---------------------------------------- ##
## Requirements over the Autoconf version. ##
## ---------------------------------------- ##
# AU::AC_PREREQ(VERSION)
# ----------------------
# Update this 'AC_PREREQ' statement to require the current version of
# Autoconf. But fail if ever this autoupdate is too old.
#
# Note that 'm4_defn([m4_PACKAGE_VERSION])' below are expanded before
# calling 'AU_DEFUN', i.e., it is hard coded. Otherwise it would be
# quite complex for autoupdate to import the value of
# 'm4_PACKAGE_VERSION'. We could 'AU_DEFUN' 'm4_PACKAGE_VERSION', but
# this would replace all its occurrences with the current version of
# Autoconf, which is certainly not what the user intended.
AU_DEFUN([AC_PREREQ],
[m4_version_prereq([$1])[]dnl
[AC_PREREQ(]]m4_dquote(m4_dquote(m4_defn([m4_PACKAGE_VERSION])))[[)]])
# AC_PREREQ(VERSION)
# ------------------
# Complain and exit if the Autoconf version is less than VERSION.
m4_undefine([AC_PREREQ])
m4_copy([m4_version_prereq], [AC_PREREQ])
# AC_AUTOCONF_VERSION
# -------------------
# The current version of Autoconf parsing this file.
m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])
## ---------------- ##
## Initialization. ##
## ---------------- ##
# All the following macros are used by AC_INIT. Ideally, they should
# be presented in the order in which they are output. Please, help us
# sorting it, or at least, don't augment the entropy.
# _AC_INIT_NOTICE
# ---------------
# Provide useful headers; override the HEADER-COMMENT created by M4sh.
m4_define([_AC_INIT_NOTICE],
[m4_cleardivert([HEADER-COMMENT])]dnl
[m4_divert_text([HEADER-COMMENT],
[@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by m4_PACKAGE_STRING[]dnl
m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
m4_ifset([AC_PACKAGE_BUGREPORT],
[m4_divert_text([HEADER-COMMENT],
[@%:@
@%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
])
# _AC_INIT_COPYRIGHT
# ------------------
# We dump to VERSION_FSF to make sure we are inserted before the
# user copyrights, and after the setup of the --version handling.
m4_define([_AC_INIT_COPYRIGHT],
[AC_COPYRIGHT(m4_defn([_AC_COPYRIGHT_YEARS]), [VERSION_FSF], [
m4_copyright_condense])dnl
AC_COPYRIGHT(
[This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.],
[VERSION_FSF], [m4_echo])])
# File Descriptors
# ----------------
# Set up the file descriptors used by 'configure'.
# File descriptor usage:
# 0 standard input (/dev/null)
# 1 file creation
# 2 errors and warnings
# AS_MESSAGE_LOG_FD compiler messages saved in config.log
# AS_MESSAGE_FD checking for... messages and results
# AS_ORIGINAL_STDIN_FD original standard input (still open)
#
# stdin is /dev/null because checks that run programs may
# inadvertently run interactive ones, which would stop configuration
# until someone typed an EOF.
m4_define([AS_MESSAGE_FD], 6)
m4_define([AS_ORIGINAL_STDIN_FD], 7)
# That's how they used to be named.
AU_ALIAS([AC_FD_CC], [AS_MESSAGE_LOG_FD])
AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
# _AC_INIT_DEFAULTS
# -----------------
# Values which defaults can be set from 'configure.ac'.
# '/bin/machine' is used in 'glibcbug'. The others are used in config.*
m4_define([_AC_INIT_DEFAULTS],
[m4_divert_push([DEFAULTS])dnl
test -n "$DJDIR" || exec AS_ORIGINAL_STDIN_FD<&0 </dev/null
exec AS_MESSAGE_FD>&1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIB@&t@OBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
AC_SUBST([SHELL])dnl
AC_SUBST([PATH_SEPARATOR])dnl
# Identity of this package.
AC_SUBST([PACKAGE_NAME],
[m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])dnl
AC_SUBST([PACKAGE_TARNAME],
[m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])dnl
AC_SUBST([PACKAGE_VERSION],
[m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])dnl
AC_SUBST([PACKAGE_STRING],
[m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])dnl
AC_SUBST([PACKAGE_BUGREPORT],
[m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
AC_SUBST([PACKAGE_URL],
[m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])dnl
m4_divert_pop([DEFAULTS])dnl
m4_wrap_lifo([m4_divert_text([DEFAULTS],
[ac_subst_vars='m4_set_dump([_AC_SUBST_VARS], m4_newline)'
ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'
ac_user_opts='
enable_option_checking
m4_ifdef([_AC_USER_OPTS], [m4_defn([_AC_USER_OPTS])
])'
m4_ifdef([_AC_PRECIOUS_VARS],
[_AC_ARG_VAR_STORE[]dnl
_AC_ARG_VAR_VALIDATE[]dnl
ac_precious_vars='m4_defn([_AC_PRECIOUS_VARS])'])
m4_ifdef([_AC_LIST_SUBDIRS],
[ac_subdirs_all='m4_defn([_AC_LIST_SUBDIRS])'])dnl
])])dnl
])# _AC_INIT_DEFAULTS
# AC_PREFIX_DEFAULT(PREFIX)
# -------------------------
AC_DEFUN([AC_PREFIX_DEFAULT],
[m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
# AC_PREFIX_PROGRAM(PROGRAM)
# --------------------------
# Guess the value for the 'prefix' variable by looking for
# the argument program along PATH and taking its parent.
# Example: if the argument is 'gcc' and we find /usr/local/gnu/bin/gcc,
# set 'prefix' to /usr/local/gnu.
# This comes too late to find a site file based on the prefix,
# and it might use a cached value for the path.
# No big loss, I think, since most configures don't use this macro anyway.
AC_DEFUN([AC_PREFIX_PROGRAM],
[if test "x$prefix" = xNONE; then
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
_AS_ECHO_N([checking for prefix by ])
AC_PATH_PROG(ac_prefix_program, [$1])
if test -n "$ac_prefix_program"; then
prefix=`AS_DIRNAME(["$ac_prefix_program"])`
prefix=`AS_DIRNAME(["$prefix"])`
fi
fi
])# AC_PREFIX_PROGRAM
# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
# ---------------------------------------------
# UNIQUE-FILE-IN-SOURCE-DIR is a file name unique to this package,
# relative to the directory that configure is in, which we can look
# for to find out if srcdir is correct.
AC_DEFUN([AC_CONFIG_SRCDIR],
[m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
# _AC_INIT_DIRCHECK
# -----------------
# Set ac_pwd, and sanity-check it and the source and installation directories.
#
# (This macro is AC_REQUIREd by _AC_INIT_SRCDIR, so it has to be AC_DEFUNed.)
#
AC_DEFUN([_AC_INIT_DIRCHECK],
[m4_divert_push([PARSE_ARGS])dnl
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
AC_MSG_ERROR([working directory cannot be determined])
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
AC_MSG_ERROR([pwd does not report name of working directory])
m4_divert_pop([PARSE_ARGS])dnl
])# _AC_INIT_DIRCHECK
# _AC_INIT_SRCDIR
# ---------------
# Compute 'srcdir' based on '$ac_unique_file'.
#
# (We have to AC_DEFUN it, since we use AC_REQUIRE.)
#
AC_DEFUN([_AC_INIT_SRCDIR],
[AC_REQUIRE([_AC_INIT_DIRCHECK])dnl
m4_divert_push([PARSE_ARGS])dnl
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`AS_DIRNAME(["$as_myself"])`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
fi
ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || AC_MSG_ERROR([$ac_msg])
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
m4_divert_pop([PARSE_ARGS])dnl
])# _AC_INIT_SRCDIR
# _AC_INIT_PARSE_ARGS
# -------------------
m4_define([_AC_INIT_PARSE_ARGS],
[m4_divert_push([PARSE_ARGS])dnl
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
AC_SUBST(exec_prefix, NONE)dnl
no_create=
no_recursion=
AC_SUBST(prefix, NONE)dnl
program_prefix=NONE
program_suffix=NONE
AC_SUBST(program_transform_name, [s,x,x,])dnl
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
AC_SUBST([bindir], ['${exec_prefix}/bin'])dnl
AC_SUBST([sbindir], ['${exec_prefix}/sbin'])dnl
AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])dnl
AC_SUBST([datarootdir], ['${prefix}/share'])dnl
AC_SUBST([datadir], ['${datarootdir}'])dnl
AC_SUBST([sysconfdir], ['${prefix}/etc'])dnl
AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
AC_SUBST([localstatedir], ['${prefix}/var'])dnl
AC_SUBST([runstatedir], ['${localstatedir}/run'])dnl
AC_SUBST([includedir], ['${prefix}/include'])dnl
AC_SUBST([oldincludedir], ['/usr/include'])dnl
AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])dnl
AC_SUBST([infodir], ['${datarootdir}/info'])dnl
AC_SUBST([htmldir], ['${docdir}'])dnl
AC_SUBST([dvidir], ['${docdir}'])dnl
AC_SUBST([pdfdir], ['${docdir}'])dnl
AC_SUBST([psdir], ['${docdir}'])dnl
AC_SUBST([libdir], ['${exec_prefix}/lib'])dnl
AC_SUBST([localedir], ['${datarootdir}/locale'])dnl
AC_SUBST([mandir], ['${datarootdir}/man'])dnl
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[[^=]]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
_AC_INIT_PARSE_ENABLE([disable])
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
_AC_INIT_PARSE_ENABLE([enable])
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
_AC_INIT_PARSE_ENABLE([with])
_AC_INIT_PARSE_ENABLE([without])
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) AC_MSG_ERROR([unrecognized option: '$ac_option'
Try '$[0] --help' for more information])
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [[0-9]]* | *[[!_$as_cr_alnum]]* )
AC_MSG_ERROR([invalid variable name: '$ac_envvar']) ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
AC_MSG_WARN([you should use --build, --host, --target])
expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
AC_MSG_WARN([invalid host type: $ac_option])
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
AC_MSG_ERROR([missing argument to $ac_option])
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;;
*) AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[[^/]]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[[\\/$]]* | ?:[[\\/]]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val])
done
# There might be people who depend on the old broken behavior: '$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
m4_divert_pop([PARSE_ARGS])dnl
])# _AC_INIT_PARSE_ARGS
# _AC_INIT_PARSE_ENABLE(OPTION-NAME)
# ----------------------------------
# A trivial front-end for _AC_INIT_PARSE_ENABLE2.
#
m4_define([_AC_INIT_PARSE_ENABLE],
[m4_bmatch([$1], [^with],
[_AC_INIT_PARSE_ENABLE2([$1], [with])],
[_AC_INIT_PARSE_ENABLE2([$1], [enable])])])
# _AC_INIT_PARSE_ENABLE2(OPTION-NAME, POSITIVE-NAME)