New upstream version 1.6
Simon Josefsson
4 years ago
0 | 0 | Libntlm AUTHORS -- information about the authors |
1 | Copyright (C) 2002-2018 Simon Josefsson | |
1 | Copyright (C) 2002-2020 Simon Josefsson | |
2 | 2 | See the end for copying conditions. |
3 | 3 | |
4 | 4 | Please do not send general e-mail about the library to the addresses |
0 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
1 | ||
2 | * NEWS: Version 1.6. | |
3 | ||
4 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
5 | ||
6 | * ChangeLog: Generated. | |
7 | ||
8 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
9 | ||
10 | * .gitignore: Ignore more. | |
11 | ||
12 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
13 | ||
14 | * build-aux/update-copyright, build-aux/useless-if-before-free, | |
15 | gl/tests/test-update-copyright.sh: Update gnulib files. | |
16 | ||
17 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
18 | ||
19 | * NEWS, THANKS: Add NEWS entry about buffer overflow bug. | |
20 | ||
21 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
22 | ||
23 | * Makefile.am, test_CVE-2019-17455.c: Add regression check for | |
24 | CVE-2019-17455 overflow. | |
25 | ||
26 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
27 | ||
28 | * ntlm.h.in, smbutil.c: Improve namespace. | |
29 | ||
30 | 2020-04-19 Simon Josefsson <simon@josefsson.org> | |
31 | ||
32 | * ntlm.h.in, smbutil.c: Fix buffer overflow. Patch from Cedric | |
33 | Buissart based on report by Kirin. CVE-2019-17455 <https://gitlab.com/jas/libntlm/-/issues/2> | |
34 | ||
35 | 2020-03-22 Simon Josefsson <simon@josefsson.org> | |
36 | ||
37 | * .clcopying, AUTHORS, ChangeLog, NEWS, README, THANKS, cfg.mk, | |
38 | configure.ac, libntlm.pc.in, libntlm4win.mk, smbencrypt.c, | |
39 | smbutil.c, test_ntlm.c: Update copyright years. | |
40 | ||
41 | 2020-03-22 Simon Josefsson <simon@josefsson.org> | |
42 | ||
43 | * Makefile.am: Modernize automake usage. | |
44 | ||
45 | 2020-03-22 Simon Josefsson <simon@josefsson.org> | |
46 | ||
47 | * .gitlab-ci.yml: Run on glr1. | |
48 | ||
49 | 2020-03-22 Simon Josefsson <simon@josefsson.org> | |
50 | ||
51 | * .gitignore, GNUmakefile, build-aux/update-copyright, | |
52 | build-aux/useless-if-before-free, build-aux/vc-list-files, | |
53 | gl/Makefile.am, gl/arg-nonnull.h, gl/byteswap.in.h, gl/c++defs.h, | |
54 | gl/cdefs.h, gl/check-version.c, gl/check-version.h, gl/des.c, | |
55 | gl/des.h, gl/libc-config.h, gl/limits.in.h, gl/m4/00gnulib.m4, | |
56 | gl/m4/__inline.m4, gl/m4/absolute-header.m4, gl/m4/autobuild.m4, | |
57 | gl/m4/byteswap.m4, gl/m4/extensions.m4, gl/m4/extern-inline.m4, | |
58 | gl/m4/gnulib-cache.m4, gl/m4/gnulib-common.m4, | |
59 | gl/m4/gnulib-comp.m4, gl/m4/gnulib-tool.m4, gl/m4/include_next.m4, | |
60 | gl/m4/inline.m4, gl/m4/inttypes-pri.m4, gl/m4/inttypes.m4, | |
61 | gl/m4/limits-h.m4, gl/m4/longlong.m4, gl/m4/manywarnings-c++.m4, | |
62 | gl/m4/manywarnings.m4, gl/m4/md4.m4, gl/m4/multiarch.m4, | |
63 | gl/m4/off_t.m4, gl/m4/ssize_t.m4, gl/m4/stdalign.m4, | |
64 | gl/m4/stdbool.m4, gl/m4/stddef_h.m4, gl/m4/stdint.m4, | |
65 | gl/m4/string_h.m4, gl/m4/strverscmp.m4, gl/m4/sys_types_h.m4, | |
66 | gl/m4/unistd_h.m4, gl/m4/valgrind-tests.m4, gl/m4/warn-on-use.m4, | |
67 | gl/m4/warnings.m4, gl/m4/wchar_h.m4, gl/m4/wchar_t.m4, | |
68 | gl/m4/wint_t.m4, gl/m4/zzgnulib.m4, gl/md4.c, gl/md4.h, | |
69 | gl/stdalign.in.h, gl/stdbool.in.h, gl/stddef.in.h, gl/stdint.in.h, | |
70 | gl/string.in.h, gl/strverscmp.c, gl/sys_types.in.h, | |
71 | gl/tests/Makefile.am, gl/tests/arg-nonnull.h, gl/tests/c++defs.h, | |
72 | gl/tests/dummy.c, gl/tests/init.sh, gl/tests/intprops.h, | |
73 | gl/tests/inttypes.in.h, gl/tests/macros.h, gl/tests/signature.h, | |
74 | gl/tests/test-byteswap.c, gl/tests/test-des.c, | |
75 | gl/tests/test-init.sh, gl/tests/test-intprops.c, | |
76 | gl/tests/test-inttypes.c, gl/tests/test-limits-h.c, | |
77 | gl/tests/test-md4.c, gl/tests/test-stdalign.c, | |
78 | gl/tests/test-stdbool.c, gl/tests/test-stddef.c, | |
79 | gl/tests/test-stdint.c, gl/tests/test-string.c, | |
80 | gl/tests/test-strverscmp.c, gl/tests/test-sys_types.c, | |
81 | gl/tests/test-unistd.c, gl/tests/test-update-copyright.sh, | |
82 | gl/tests/test-vc-list-files-cvs.sh, | |
83 | gl/tests/test-vc-list-files-git.sh, gl/tests/test-verify-try.c, | |
84 | gl/tests/test-verify.c, gl/tests/test-wchar.c, gl/tests/verify.h, | |
85 | gl/tests/warn-on-use.h, gl/tests/wchar.in.h, gl/unistd.in.h, | |
86 | gl/warn-on-use.h, maint.mk: Update gnulib files. | |
87 | ||
88 | 2019-07-20 Simon Josefsson <simon@josefsson.org> | |
89 | ||
90 | * .clcopying, AUTHORS, ChangeLog, Makefile.am, NEWS, README, | |
91 | THANKS, cfg.mk, libntlm.pc.in, libntlm4win.mk, smbencrypt.c, | |
92 | smbutil.c, test_ntlm.c: Update copyright years. | |
93 | ||
94 | 2019-07-20 Simon Josefsson <simon@josefsson.org> | |
95 | ||
96 | * build-aux/update-copyright, gl/Makefile.am, | |
97 | gl/m4/gnulib-cache.m4, gl/m4/gnulib-comp.m4, gl/tests/Makefile.am, | |
98 | gl/tests/test-update-copyright.sh: Add update-copyright gnulib | |
99 | module. | |
100 | ||
101 | 2019-07-20 Simon Josefsson <simon@josefsson.org> | |
102 | ||
103 | * GNUmakefile, build-aux/useless-if-before-free, | |
104 | build-aux/vc-list-files, gl/Makefile.am, gl/arg-nonnull.h, | |
105 | gl/byteswap.in.h, gl/c++defs.h, gl/cdefs.h, gl/check-version.c, | |
106 | gl/check-version.h, gl/des.c, gl/des.h, gl/libc-config.h, | |
107 | gl/limits.in.h, gl/m4/00gnulib.m4, gl/m4/__inline.m4, | |
108 | gl/m4/absolute-header.m4, gl/m4/autobuild.m4, gl/m4/byteswap.m4, | |
109 | gl/m4/extensions.m4, gl/m4/extern-inline.m4, gl/m4/gnulib-cache.m4, | |
110 | gl/m4/gnulib-common.m4, gl/m4/gnulib-comp.m4, gl/m4/gnulib-tool.m4, | |
111 | gl/m4/include_next.m4, gl/m4/inline.m4, gl/m4/inttypes-pri.m4, | |
112 | gl/m4/inttypes.m4, gl/m4/limits-h.m4, gl/m4/longlong.m4, | |
113 | gl/m4/manywarnings-c++.m4, gl/m4/manywarnings.m4, gl/m4/md4.m4, | |
114 | gl/m4/multiarch.m4, gl/m4/off_t.m4, gl/m4/ssize_t.m4, | |
115 | gl/m4/stdalign.m4, gl/m4/stdbool.m4, gl/m4/stddef_h.m4, | |
116 | gl/m4/stdint.m4, gl/m4/string_h.m4, gl/m4/strverscmp.m4, | |
117 | gl/m4/sys_types_h.m4, gl/m4/unistd_h.m4, gl/m4/valgrind-tests.m4, | |
118 | gl/m4/warn-on-use.m4, gl/m4/warnings.m4, gl/m4/wchar_h.m4, | |
119 | gl/m4/wchar_t.m4, gl/m4/wint_t.m4, gl/md4.c, gl/md4.h, | |
120 | gl/stdalign.in.h, gl/stdbool.in.h, gl/stddef.in.h, gl/stdint.in.h, | |
121 | gl/string.in.h, gl/strverscmp.c, gl/sys_types.in.h, | |
122 | gl/tests/Makefile.am, gl/tests/arg-nonnull.h, gl/tests/c++defs.h, | |
123 | gl/tests/dummy.c, gl/tests/init.sh, gl/tests/intprops.h, | |
124 | gl/tests/inttypes.in.h, gl/tests/macros.h, gl/tests/signature.h, | |
125 | gl/tests/test-byteswap.c, gl/tests/test-des.c, | |
126 | gl/tests/test-init.sh, gl/tests/test-intprops.c, | |
127 | gl/tests/test-inttypes.c, gl/tests/test-limits-h.c, | |
128 | gl/tests/test-md4.c, gl/tests/test-stdalign.c, | |
129 | gl/tests/test-stdbool.c, gl/tests/test-stddef.c, | |
130 | gl/tests/test-stdint.c, gl/tests/test-string.c, | |
131 | gl/tests/test-strverscmp.c, gl/tests/test-sys_types.c, | |
132 | gl/tests/test-unistd.c, gl/tests/test-vc-list-files-cvs.sh, | |
133 | gl/tests/test-vc-list-files-git.sh, gl/tests/test-verify-try.c, | |
134 | gl/tests/test-verify.c, gl/tests/test-wchar.c, gl/tests/verify.h, | |
135 | gl/tests/warn-on-use.h, gl/tests/wchar.in.h, gl/unistd.in.h, | |
136 | gl/warn-on-use.h, maint.mk: Update gnulib files. | |
137 | ||
138 | 2019-07-20 Simon Josefsson <simon@josefsson.org> | |
139 | ||
140 | * configure.ac: Bump AC_PREREQ for gnulib. | |
141 | ||
142 | 2018-08-24 Simon Josefsson <simon@josefsson.org> | |
143 | ||
144 | * NEWS, configure.ac: Bump versions. | |
145 | ||
146 | 2018-08-24 Simon Josefsson <simon@josefsson.org> | |
147 | ||
148 | * .gitignore: Ignore more. | |
149 | ||
150 | 2018-08-24 Simon Josefsson <simon@josefsson.org> | |
151 | ||
152 | * ChangeLog: Generated. | |
153 | ||
0 | 154 | 2018-08-24 Simon Josefsson <simon@josefsson.org> |
1 | 155 | |
2 | 156 | * NEWS: Version 1.5. |
1736 | 1890 | 88403e851f297b227df9ca509fbabb7b |
1737 | 1891 | |
1738 | 1892 | ---------------------------------------------------------------------- |
1739 | Copyright 2002-2018 Simon Josefsson | |
1893 | Copyright 2002-2020 Simon Josefsson | |
1740 | 1894 | Copying and distribution of this file, with or without modification, |
1741 | 1895 | are permitted in any medium without royalty provided the copyright |
1742 | 1896 | notice and this notice are preserved. |
4 | 4 | # It is necessary if you want to build targets usually of interest |
5 | 5 | # only to the maintainer. |
6 | 6 | |
7 | # Copyright (C) 2001, 2003, 2006-2018 Free Software Foundation, Inc. | |
7 | # Copyright (C) 2001, 2003, 2006-2020 Free Software Foundation, Inc. | |
8 | 8 | |
9 | 9 | # This program is free software: you can redistribute it and/or modify |
10 | 10 | # it under the terms of the GNU General Public License as published by |
0 | 0 | Installation Instructions |
1 | 1 | ************************* |
2 | 2 | |
3 | Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, | |
4 | Inc. | |
3 | Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software | |
4 | Foundation, Inc. | |
5 | 5 | |
6 | 6 | Copying and distribution of this file, with or without modification, |
7 | 7 | are permitted in any medium without royalty provided the copyright |
11 | 11 | Basic Installation |
12 | 12 | ================== |
13 | 13 | |
14 | Briefly, the shell command `./configure && make && make install' | |
14 | Briefly, the shell command './configure && make && make install' | |
15 | 15 | should configure, build, and install this package. The following |
16 | more-detailed instructions are generic; see the `README' file for | |
16 | more-detailed instructions are generic; see the 'README' file for | |
17 | 17 | instructions specific to this package. Some packages provide this |
18 | `INSTALL' file but do not implement all of the features documented | |
18 | 'INSTALL' file but do not implement all of the features documented | |
19 | 19 | below. The lack of an optional feature in a given package is not |
20 | 20 | necessarily a bug. More recommendations for GNU packages can be found |
21 | 21 | in *note Makefile Conventions: (standards)Makefile Conventions. |
22 | 22 | |
23 | The `configure' shell script attempts to guess correct values for | |
23 | The 'configure' shell script attempts to guess correct values for | |
24 | 24 | various system-dependent variables used during compilation. It uses |
25 | those values to create a `Makefile' in each directory of the package. | |
26 | It may also create one or more `.h' files containing system-dependent | |
27 | definitions. Finally, it creates a shell script `config.status' that | |
25 | those values to create a 'Makefile' in each directory of the package. | |
26 | It may also create one or more '.h' files containing system-dependent | |
27 | definitions. Finally, it creates a shell script 'config.status' that | |
28 | 28 | you can run in the future to recreate the current configuration, and a |
29 | file `config.log' containing compiler output (useful mainly for | |
30 | debugging `configure'). | |
31 | ||
32 | It can also use an optional file (typically called `config.cache' | |
33 | and enabled with `--cache-file=config.cache' or simply `-C') that saves | |
34 | the results of its tests to speed up reconfiguring. Caching is | |
35 | disabled by default to prevent problems with accidental use of stale | |
36 | cache files. | |
29 | file 'config.log' containing compiler output (useful mainly for | |
30 | debugging 'configure'). | |
31 | ||
32 | It can also use an optional file (typically called 'config.cache' and | |
33 | enabled with '--cache-file=config.cache' or simply '-C') that saves the | |
34 | results of its tests to speed up reconfiguring. Caching is disabled by | |
35 | default to prevent problems with accidental use of stale cache files. | |
37 | 36 | |
38 | 37 | If you need to do unusual things to compile the package, please try |
39 | to figure out how `configure' could check whether to do them, and mail | |
40 | diffs or instructions to the address given in the `README' so they can | |
38 | to figure out how 'configure' could check whether to do them, and mail | |
39 | diffs or instructions to the address given in the 'README' so they can | |
41 | 40 | be considered for the next release. If you are using the cache, and at |
42 | some point `config.cache' contains results you don't want to keep, you | |
41 | some point 'config.cache' contains results you don't want to keep, you | |
43 | 42 | may remove or edit it. |
44 | 43 | |
45 | The file `configure.ac' (or `configure.in') is used to create | |
46 | `configure' by a program called `autoconf'. You need `configure.ac' if | |
47 | you want to change it or regenerate `configure' using a newer version | |
48 | of `autoconf'. | |
44 | The file 'configure.ac' (or 'configure.in') is used to create | |
45 | 'configure' by a program called 'autoconf'. You need 'configure.ac' if | |
46 | you want to change it or regenerate 'configure' using a newer version of | |
47 | 'autoconf'. | |
49 | 48 | |
50 | 49 | The simplest way to compile this package is: |
51 | 50 | |
52 | 1. `cd' to the directory containing the package's source code and type | |
53 | `./configure' to configure the package for your system. | |
54 | ||
55 | Running `configure' might take a while. While running, it prints | |
51 | 1. 'cd' to the directory containing the package's source code and type | |
52 | './configure' to configure the package for your system. | |
53 | ||
54 | Running 'configure' might take a while. While running, it prints | |
56 | 55 | some messages telling which features it is checking for. |
57 | 56 | |
58 | 2. Type `make' to compile the package. | |
59 | ||
60 | 3. Optionally, type `make check' to run any self-tests that come with | |
57 | 2. Type 'make' to compile the package. | |
58 | ||
59 | 3. Optionally, type 'make check' to run any self-tests that come with | |
61 | 60 | the package, generally using the just-built uninstalled binaries. |
62 | 61 | |
63 | 4. Type `make install' to install the programs and any data files and | |
62 | 4. Type 'make install' to install the programs and any data files and | |
64 | 63 | documentation. When installing into a prefix owned by root, it is |
65 | 64 | recommended that the package be configured and built as a regular |
66 | user, and only the `make install' phase executed with root | |
65 | user, and only the 'make install' phase executed with root | |
67 | 66 | privileges. |
68 | 67 | |
69 | 5. Optionally, type `make installcheck' to repeat any self-tests, but | |
68 | 5. Optionally, type 'make installcheck' to repeat any self-tests, but | |
70 | 69 | this time using the binaries in their final installed location. |
71 | 70 | This target does not install anything. Running this target as a |
72 | regular user, particularly if the prior `make install' required | |
71 | regular user, particularly if the prior 'make install' required | |
73 | 72 | root privileges, verifies that the installation completed |
74 | 73 | correctly. |
75 | 74 | |
76 | 75 | 6. You can remove the program binaries and object files from the |
77 | source code directory by typing `make clean'. To also remove the | |
78 | files that `configure' created (so you can compile the package for | |
79 | a different kind of computer), type `make distclean'. There is | |
80 | also a `make maintainer-clean' target, but that is intended mainly | |
76 | source code directory by typing 'make clean'. To also remove the | |
77 | files that 'configure' created (so you can compile the package for | |
78 | a different kind of computer), type 'make distclean'. There is | |
79 | also a 'make maintainer-clean' target, but that is intended mainly | |
81 | 80 | for the package's developers. If you use it, you may have to get |
82 | 81 | all sorts of other programs in order to regenerate files that came |
83 | 82 | with the distribution. |
84 | 83 | |
85 | 7. Often, you can also type `make uninstall' to remove the installed | |
84 | 7. Often, you can also type 'make uninstall' to remove the installed | |
86 | 85 | files again. In practice, not all packages have tested that |
87 | 86 | uninstallation works correctly, even though it is required by the |
88 | 87 | GNU Coding Standards. |
89 | 88 | |
90 | 8. Some packages, particularly those that use Automake, provide `make | |
89 | 8. Some packages, particularly those that use Automake, provide 'make | |
91 | 90 | distcheck', which can by used by developers to test that all other |
92 | targets like `make install' and `make uninstall' work correctly. | |
91 | targets like 'make install' and 'make uninstall' work correctly. | |
93 | 92 | This target is generally not run by end users. |
94 | 93 | |
95 | 94 | Compilers and Options |
96 | 95 | ===================== |
97 | 96 | |
98 | 97 | Some systems require unusual options for compilation or linking that |
99 | the `configure' script does not know about. Run `./configure --help' | |
98 | the 'configure' script does not know about. Run './configure --help' | |
100 | 99 | for details on some of the pertinent environment variables. |
101 | 100 | |
102 | You can give `configure' initial values for configuration parameters | |
103 | by setting variables in the command line or in the environment. Here | |
104 | is an example: | |
101 | You can give 'configure' initial values for configuration parameters | |
102 | by setting variables in the command line or in the environment. Here is | |
103 | an example: | |
105 | 104 | |
106 | 105 | ./configure CC=c99 CFLAGS=-g LIBS=-lposix |
107 | 106 | |
112 | 111 | |
113 | 112 | You can compile the package for more than one kind of computer at the |
114 | 113 | same time, by placing the object files for each architecture in their |
115 | own directory. To do this, you can use GNU `make'. `cd' to the | |
114 | own directory. To do this, you can use GNU 'make'. 'cd' to the | |
116 | 115 | directory where you want the object files and executables to go and run |
117 | the `configure' script. `configure' automatically checks for the | |
118 | source code in the directory that `configure' is in and in `..'. This | |
119 | is known as a "VPATH" build. | |
120 | ||
121 | With a non-GNU `make', it is safer to compile the package for one | |
116 | the 'configure' script. 'configure' automatically checks for the source | |
117 | code in the directory that 'configure' is in and in '..'. This is known | |
118 | as a "VPATH" build. | |
119 | ||
120 | With a non-GNU 'make', it is safer to compile the package for one | |
122 | 121 | architecture at a time in the source code directory. After you have |
123 | installed the package for one architecture, use `make distclean' before | |
122 | installed the package for one architecture, use 'make distclean' before | |
124 | 123 | reconfiguring for another architecture. |
125 | 124 | |
126 | 125 | On MacOS X 10.5 and later systems, you can create libraries and |
127 | 126 | executables that work on multiple system types--known as "fat" or |
128 | "universal" binaries--by specifying multiple `-arch' options to the | |
129 | compiler but only a single `-arch' option to the preprocessor. Like | |
127 | "universal" binaries--by specifying multiple '-arch' options to the | |
128 | compiler but only a single '-arch' option to the preprocessor. Like | |
130 | 129 | this: |
131 | 130 | |
132 | 131 | ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ |
135 | 134 | |
136 | 135 | This is not guaranteed to produce working output in all cases, you |
137 | 136 | may have to build one architecture at a time and combine the results |
138 | using the `lipo' tool if you have problems. | |
137 | using the 'lipo' tool if you have problems. | |
139 | 138 | |
140 | 139 | Installation Names |
141 | 140 | ================== |
142 | 141 | |
143 | By default, `make install' installs the package's commands under | |
144 | `/usr/local/bin', include files under `/usr/local/include', etc. You | |
145 | can specify an installation prefix other than `/usr/local' by giving | |
146 | `configure' the option `--prefix=PREFIX', where PREFIX must be an | |
142 | By default, 'make install' installs the package's commands under | |
143 | '/usr/local/bin', include files under '/usr/local/include', etc. You | |
144 | can specify an installation prefix other than '/usr/local' by giving | |
145 | 'configure' the option '--prefix=PREFIX', where PREFIX must be an | |
147 | 146 | absolute file name. |
148 | 147 | |
149 | 148 | You can specify separate installation prefixes for |
150 | 149 | architecture-specific files and architecture-independent files. If you |
151 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses | |
150 | pass the option '--exec-prefix=PREFIX' to 'configure', the package uses | |
152 | 151 | PREFIX as the prefix for installing programs and libraries. |
153 | 152 | Documentation and other data files still use the regular prefix. |
154 | 153 | |
155 | 154 | In addition, if you use an unusual directory layout you can give |
156 | options like `--bindir=DIR' to specify different values for particular | |
157 | kinds of files. Run `configure --help' for a list of the directories | |
158 | you can set and what kinds of files go in them. In general, the | |
159 | default for these options is expressed in terms of `${prefix}', so that | |
160 | specifying just `--prefix' will affect all of the other directory | |
155 | options like '--bindir=DIR' to specify different values for particular | |
156 | kinds of files. Run 'configure --help' for a list of the directories | |
157 | you can set and what kinds of files go in them. In general, the default | |
158 | for these options is expressed in terms of '${prefix}', so that | |
159 | specifying just '--prefix' will affect all of the other directory | |
161 | 160 | specifications that were not explicitly provided. |
162 | 161 | |
163 | 162 | The most portable way to affect installation locations is to pass the |
164 | correct locations to `configure'; however, many packages provide one or | |
163 | correct locations to 'configure'; however, many packages provide one or | |
165 | 164 | both of the following shortcuts of passing variable assignments to the |
166 | `make install' command line to change installation locations without | |
165 | 'make install' command line to change installation locations without | |
167 | 166 | having to reconfigure or recompile. |
168 | 167 | |
169 | 168 | The first method involves providing an override variable for each |
170 | affected directory. For example, `make install | |
169 | affected directory. For example, 'make install | |
171 | 170 | prefix=/alternate/directory' will choose an alternate location for all |
172 | 171 | directory configuration variables that were expressed in terms of |
173 | `${prefix}'. Any directories that were specified during `configure', | |
174 | but not in terms of `${prefix}', must each be overridden at install | |
175 | time for the entire installation to be relocated. The approach of | |
176 | makefile variable overrides for each directory variable is required by | |
177 | the GNU Coding Standards, and ideally causes no recompilation. | |
178 | However, some platforms have known limitations with the semantics of | |
179 | shared libraries that end up requiring recompilation when using this | |
180 | method, particularly noticeable in packages that use GNU Libtool. | |
181 | ||
182 | The second method involves providing the `DESTDIR' variable. For | |
183 | example, `make install DESTDIR=/alternate/directory' will prepend | |
184 | `/alternate/directory' before all installation names. The approach of | |
185 | `DESTDIR' overrides is not required by the GNU Coding Standards, and | |
172 | '${prefix}'. Any directories that were specified during 'configure', | |
173 | but not in terms of '${prefix}', must each be overridden at install time | |
174 | for the entire installation to be relocated. The approach of makefile | |
175 | variable overrides for each directory variable is required by the GNU | |
176 | Coding Standards, and ideally causes no recompilation. However, some | |
177 | platforms have known limitations with the semantics of shared libraries | |
178 | that end up requiring recompilation when using this method, particularly | |
179 | noticeable in packages that use GNU Libtool. | |
180 | ||
181 | The second method involves providing the 'DESTDIR' variable. For | |
182 | example, 'make install DESTDIR=/alternate/directory' will prepend | |
183 | '/alternate/directory' before all installation names. The approach of | |
184 | 'DESTDIR' overrides is not required by the GNU Coding Standards, and | |
186 | 185 | does not work on platforms that have drive letters. On the other hand, |
187 | 186 | it does better at avoiding recompilation issues, and works well even |
188 | when some directory options were not specified in terms of `${prefix}' | |
189 | at `configure' time. | |
187 | when some directory options were not specified in terms of '${prefix}' | |
188 | at 'configure' time. | |
190 | 189 | |
191 | 190 | Optional Features |
192 | 191 | ================= |
193 | 192 | |
194 | 193 | If the package supports it, you can cause programs to be installed |
195 | with an extra prefix or suffix on their names by giving `configure' the | |
196 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. | |
197 | ||
198 | Some packages pay attention to `--enable-FEATURE' options to | |
199 | `configure', where FEATURE indicates an optional part of the package. | |
200 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE | |
201 | is something like `gnu-as' or `x' (for the X Window System). The | |
202 | `README' should mention any `--enable-' and `--with-' options that the | |
194 | with an extra prefix or suffix on their names by giving 'configure' the | |
195 | option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. | |
196 | ||
197 | Some packages pay attention to '--enable-FEATURE' options to | |
198 | 'configure', where FEATURE indicates an optional part of the package. | |
199 | They may also pay attention to '--with-PACKAGE' options, where PACKAGE | |
200 | is something like 'gnu-as' or 'x' (for the X Window System). The | |
201 | 'README' should mention any '--enable-' and '--with-' options that the | |
203 | 202 | package recognizes. |
204 | 203 | |
205 | For packages that use the X Window System, `configure' can usually | |
204 | For packages that use the X Window System, 'configure' can usually | |
206 | 205 | find the X include and library files automatically, but if it doesn't, |
207 | you can use the `configure' options `--x-includes=DIR' and | |
208 | `--x-libraries=DIR' to specify their locations. | |
206 | you can use the 'configure' options '--x-includes=DIR' and | |
207 | '--x-libraries=DIR' to specify their locations. | |
209 | 208 | |
210 | 209 | Some packages offer the ability to configure how verbose the |
211 | execution of `make' will be. For these packages, running `./configure | |
210 | execution of 'make' will be. For these packages, running './configure | |
212 | 211 | --enable-silent-rules' sets the default to minimal output, which can be |
213 | overridden with `make V=1'; while running `./configure | |
212 | overridden with 'make V=1'; while running './configure | |
214 | 213 | --disable-silent-rules' sets the default to verbose, which can be |
215 | overridden with `make V=0'. | |
214 | overridden with 'make V=0'. | |
216 | 215 | |
217 | 216 | Particular systems |
218 | 217 | ================== |
219 | 218 | |
220 | On HP-UX, the default C compiler is not ANSI C compatible. If GNU | |
221 | CC is not installed, it is recommended to use the following options in | |
219 | On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC | |
220 | is not installed, it is recommended to use the following options in | |
222 | 221 | order to use an ANSI C compiler: |
223 | 222 | |
224 | 223 | ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" |
225 | 224 | |
226 | 225 | and if that doesn't work, install pre-built binaries of GCC for HP-UX. |
227 | 226 | |
228 | HP-UX `make' updates targets which have the same time stamps as | |
229 | their prerequisites, which makes it generally unusable when shipped | |
230 | generated files such as `configure' are involved. Use GNU `make' | |
231 | instead. | |
227 | HP-UX 'make' updates targets which have the same time stamps as their | |
228 | prerequisites, which makes it generally unusable when shipped generated | |
229 | files such as 'configure' are involved. Use GNU 'make' instead. | |
232 | 230 | |
233 | 231 | On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot |
234 | parse its `<wchar.h>' header file. The option `-nodtk' can be used as | |
235 | a workaround. If GNU CC is not installed, it is therefore recommended | |
236 | to try | |
232 | parse its '<wchar.h>' header file. The option '-nodtk' can be used as a | |
233 | workaround. If GNU CC is not installed, it is therefore recommended to | |
234 | try | |
237 | 235 | |
238 | 236 | ./configure CC="cc" |
239 | 237 | |
241 | 239 | |
242 | 240 | ./configure CC="cc -nodtk" |
243 | 241 | |
244 | On Solaris, don't put `/usr/ucb' early in your `PATH'. This | |
242 | On Solaris, don't put '/usr/ucb' early in your 'PATH'. This | |
245 | 243 | directory contains several dysfunctional programs; working variants of |
246 | these programs are available in `/usr/bin'. So, if you need `/usr/ucb' | |
247 | in your `PATH', put it _after_ `/usr/bin'. | |
248 | ||
249 | On Haiku, software installed for all users goes in `/boot/common', | |
250 | not `/usr/local'. It is recommended to use the following options: | |
244 | these programs are available in '/usr/bin'. So, if you need '/usr/ucb' | |
245 | in your 'PATH', put it _after_ '/usr/bin'. | |
246 | ||
247 | On Haiku, software installed for all users goes in '/boot/common', | |
248 | not '/usr/local'. It is recommended to use the following options: | |
251 | 249 | |
252 | 250 | ./configure --prefix=/boot/common |
253 | 251 | |
254 | 252 | Specifying the System Type |
255 | 253 | ========================== |
256 | 254 | |
257 | There may be some features `configure' cannot figure out | |
255 | There may be some features 'configure' cannot figure out | |
258 | 256 | automatically, but needs to determine by the type of machine the package |
259 | 257 | will run on. Usually, assuming the package is built to be run on the |
260 | _same_ architectures, `configure' can figure that out, but if it prints | |
258 | _same_ architectures, 'configure' can figure that out, but if it prints | |
261 | 259 | a message saying it cannot guess the machine type, give it the |
262 | `--build=TYPE' option. TYPE can either be a short name for the system | |
263 | type, such as `sun4', or a canonical name which has the form: | |
260 | '--build=TYPE' option. TYPE can either be a short name for the system | |
261 | type, such as 'sun4', or a canonical name which has the form: | |
264 | 262 | |
265 | 263 | CPU-COMPANY-SYSTEM |
266 | 264 | |
269 | 267 | OS |
270 | 268 | KERNEL-OS |
271 | 269 | |
272 | See the file `config.sub' for the possible values of each field. If | |
273 | `config.sub' isn't included in this package, then this package doesn't | |
270 | See the file 'config.sub' for the possible values of each field. If | |
271 | 'config.sub' isn't included in this package, then this package doesn't | |
274 | 272 | need to know the machine type. |
275 | 273 | |
276 | 274 | If you are _building_ compiler tools for cross-compiling, you should |
277 | use the option `--target=TYPE' to select the type of system they will | |
275 | use the option '--target=TYPE' to select the type of system they will | |
278 | 276 | produce code for. |
279 | 277 | |
280 | 278 | If you want to _use_ a cross compiler, that generates code for a |
281 | 279 | platform different from the build platform, you should specify the |
282 | 280 | "host" platform (i.e., that on which the generated programs will |
283 | eventually be run) with `--host=TYPE'. | |
281 | eventually be run) with '--host=TYPE'. | |
284 | 282 | |
285 | 283 | Sharing Defaults |
286 | 284 | ================ |
287 | 285 | |
288 | If you want to set default values for `configure' scripts to share, | |
289 | you can create a site shell script called `config.site' that gives | |
290 | default values for variables like `CC', `cache_file', and `prefix'. | |
291 | `configure' looks for `PREFIX/share/config.site' if it exists, then | |
292 | `PREFIX/etc/config.site' if it exists. Or, you can set the | |
293 | `CONFIG_SITE' environment variable to the location of the site script. | |
294 | A warning: not all `configure' scripts look for a site script. | |
286 | If you want to set default values for 'configure' scripts to share, | |
287 | you can create a site shell script called 'config.site' that gives | |
288 | default values for variables like 'CC', 'cache_file', and 'prefix'. | |
289 | 'configure' looks for 'PREFIX/share/config.site' if it exists, then | |
290 | 'PREFIX/etc/config.site' if it exists. Or, you can set the | |
291 | 'CONFIG_SITE' environment variable to the location of the site script. | |
292 | A warning: not all 'configure' scripts look for a site script. | |
295 | 293 | |
296 | 294 | Defining Variables |
297 | 295 | ================== |
298 | 296 | |
299 | 297 | Variables not defined in a site shell script can be set in the |
300 | environment passed to `configure'. However, some packages may run | |
298 | environment passed to 'configure'. However, some packages may run | |
301 | 299 | configure again during the build, and the customized values of these |
302 | 300 | variables may be lost. In order to avoid this problem, you should set |
303 | them in the `configure' command line, using `VAR=value'. For example: | |
301 | them in the 'configure' command line, using 'VAR=value'. For example: | |
304 | 302 | |
305 | 303 | ./configure CC=/usr/local2/bin/gcc |
306 | 304 | |
307 | causes the specified `gcc' to be used as the C compiler (unless it is | |
305 | causes the specified 'gcc' to be used as the C compiler (unless it is | |
308 | 306 | overridden in the site shell script). |
309 | 307 | |
310 | Unfortunately, this technique does not work for `CONFIG_SHELL' due to | |
311 | an Autoconf limitation. Until the limitation is lifted, you can use | |
312 | this workaround: | |
308 | Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an | |
309 | Autoconf limitation. Until the limitation is lifted, you can use this | |
310 | workaround: | |
313 | 311 | |
314 | 312 | CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash |
315 | 313 | |
316 | `configure' Invocation | |
314 | 'configure' Invocation | |
317 | 315 | ====================== |
318 | 316 | |
319 | `configure' recognizes the following options to control how it | |
317 | 'configure' recognizes the following options to control how it | |
320 | 318 | operates. |
321 | 319 | |
322 | `--help' | |
323 | `-h' | |
324 | Print a summary of all of the options to `configure', and exit. | |
325 | ||
326 | `--help=short' | |
327 | `--help=recursive' | |
320 | '--help' | |
321 | '-h' | |
322 | Print a summary of all of the options to 'configure', and exit. | |
323 | ||
324 | '--help=short' | |
325 | '--help=recursive' | |
328 | 326 | Print a summary of the options unique to this package's |
329 | `configure', and exit. The `short' variant lists options used | |
330 | only in the top level, while the `recursive' variant lists options | |
331 | also present in any nested packages. | |
332 | ||
333 | `--version' | |
334 | `-V' | |
335 | Print the version of Autoconf used to generate the `configure' | |
327 | 'configure', and exit. The 'short' variant lists options used only | |
328 | in the top level, while the 'recursive' variant lists options also | |
329 | present in any nested packages. | |
330 | ||
331 | '--version' | |
332 | '-V' | |
333 | Print the version of Autoconf used to generate the 'configure' | |
336 | 334 | script, and exit. |
337 | 335 | |
338 | `--cache-file=FILE' | |
336 | '--cache-file=FILE' | |
339 | 337 | Enable the cache: use and save the results of the tests in FILE, |
340 | traditionally `config.cache'. FILE defaults to `/dev/null' to | |
338 | traditionally 'config.cache'. FILE defaults to '/dev/null' to | |
341 | 339 | disable caching. |
342 | 340 | |
343 | `--config-cache' | |
344 | `-C' | |
345 | Alias for `--cache-file=config.cache'. | |
346 | ||
347 | `--quiet' | |
348 | `--silent' | |
349 | `-q' | |
341 | '--config-cache' | |
342 | '-C' | |
343 | Alias for '--cache-file=config.cache'. | |
344 | ||
345 | '--quiet' | |
346 | '--silent' | |
347 | '-q' | |
350 | 348 | Do not print messages saying which checks are being made. To |
351 | suppress all normal output, redirect it to `/dev/null' (any error | |
349 | suppress all normal output, redirect it to '/dev/null' (any error | |
352 | 350 | messages will still be shown). |
353 | 351 | |
354 | `--srcdir=DIR' | |
352 | '--srcdir=DIR' | |
355 | 353 | Look for the package's source code in directory DIR. Usually |
356 | `configure' can determine that directory automatically. | |
357 | ||
358 | `--prefix=DIR' | |
359 | Use DIR as the installation prefix. *note Installation Names:: | |
360 | for more details, including other options available for fine-tuning | |
361 | the installation locations. | |
362 | ||
363 | `--no-create' | |
364 | `-n' | |
354 | 'configure' can determine that directory automatically. | |
355 | ||
356 | '--prefix=DIR' | |
357 | Use DIR as the installation prefix. *note Installation Names:: for | |
358 | more details, including other options available for fine-tuning the | |
359 | installation locations. | |
360 | ||
361 | '--no-create' | |
362 | '-n' | |
365 | 363 | Run the configure checks, but stop before creating any output |
366 | 364 | files. |
367 | 365 | |
368 | `configure' also accepts some other, not widely useful, options. Run | |
369 | `configure --help' for more details. | |
366 | 'configure' also accepts some other, not widely useful, options. Run | |
367 | 'configure --help' for more details. |
0 | 0 | ## Process this file with automake to produce Makefile.in |
1 | # Copyright (C) 2002-2018 Simon Josefsson. | |
1 | # Copyright (C) 2002-2020 Simon Josefsson. | |
2 | 2 | # |
3 | 3 | # This file is part of Libntlm. |
4 | 4 | # |
44 | 44 | |
45 | 45 | # test |
46 | 46 | |
47 | TESTS = test_ntlm | |
47 | TESTS = test_ntlm test_CVE-2019-17455 | |
48 | 48 | check_PROGRAMS = $(TESTS) |
49 | 49 | LDADD = libntlm_impl.la gl/libgnu.la |
50 | 50 | CLEANFILES = test.out |
51 | 51 | test_ntlm_LDFLAGS = -no-install |
52 | 52 | |
53 | TESTS_ENVIRONMENT = $(VALGRIND) | |
53 | LOG_COMPILER = $(VALGRIND) |
0 | # Makefile.in generated by automake 1.15 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2014 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
13 | 13 | |
14 | 14 | @SET_MAKE@ |
15 | 15 | |
16 | # Copyright (C) 2002-2018 Simon Josefsson. | |
16 | # Copyright (C) 2002-2020 Simon Josefsson. | |
17 | 17 | # |
18 | 18 | # This file is part of Libntlm. |
19 | 19 | # |
108 | 108 | POST_UNINSTALL = : |
109 | 109 | build_triplet = @build@ |
110 | 110 | host_triplet = @host@ |
111 | TESTS = test_ntlm$(EXEEXT) | |
111 | TESTS = test_ntlm$(EXEEXT) test_CVE-2019-17455$(EXEEXT) | |
112 | 112 | check_PROGRAMS = $(am__EXEEXT_1) |
113 | 113 | subdir = . |
114 | 114 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
115 | 115 | am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ |
116 | $(top_srcdir)/gl/m4/__inline.m4 \ | |
116 | 117 | $(top_srcdir)/gl/m4/absolute-header.m4 \ |
117 | 118 | $(top_srcdir)/gl/m4/autobuild.m4 \ |
118 | 119 | $(top_srcdir)/gl/m4/byteswap.m4 \ |
125 | 126 | $(top_srcdir)/gl/m4/inttypes-pri.m4 \ |
126 | 127 | $(top_srcdir)/gl/m4/inttypes.m4 \ |
127 | 128 | $(top_srcdir)/gl/m4/limits-h.m4 \ |
128 | $(top_srcdir)/gl/m4/longlong.m4 \ | |
129 | 129 | $(top_srcdir)/gl/m4/manywarnings.m4 $(top_srcdir)/gl/m4/md4.m4 \ |
130 | 130 | $(top_srcdir)/gl/m4/multiarch.m4 $(top_srcdir)/gl/m4/off_t.m4 \ |
131 | 131 | $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdalign.m4 \ |
138 | 138 | $(top_srcdir)/gl/m4/warn-on-use.m4 \ |
139 | 139 | $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_h.m4 \ |
140 | 140 | $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ |
141 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
142 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
143 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
141 | $(top_srcdir)/gl/m4/zzgnulib.m4 $(top_srcdir)/m4/libtool.m4 \ | |
142 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
143 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
144 | $(top_srcdir)/configure.ac | |
144 | 145 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
145 | 146 | $(ACLOCAL_M4) |
146 | 147 | DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ |
151 | 152 | CONFIG_HEADER = config.h |
152 | 153 | CONFIG_CLEAN_FILES = libntlm.pc libntlm.spec ntlm.h |
153 | 154 | CONFIG_CLEAN_VPATH_FILES = |
155 | am__EXEEXT_1 = test_ntlm$(EXEEXT) test_CVE-2019-17455$(EXEEXT) | |
154 | 156 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; |
155 | 157 | am__vpath_adj = case $$p in \ |
156 | 158 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ |
194 | 196 | libntlm_impl_la_LIBADD = |
195 | 197 | am_libntlm_impl_la_OBJECTS = smbutil.lo smbencrypt.lo |
196 | 198 | libntlm_impl_la_OBJECTS = $(am_libntlm_impl_la_OBJECTS) |
197 | am__EXEEXT_1 = test_ntlm$(EXEEXT) | |
199 | test_CVE_2019_17455_SOURCES = test_CVE-2019-17455.c | |
200 | test_CVE_2019_17455_OBJECTS = test_CVE-2019-17455.$(OBJEXT) | |
201 | test_CVE_2019_17455_LDADD = $(LDADD) | |
202 | test_CVE_2019_17455_DEPENDENCIES = libntlm_impl.la gl/libgnu.la | |
198 | 203 | test_ntlm_SOURCES = test_ntlm.c |
199 | 204 | test_ntlm_OBJECTS = test_ntlm.$(OBJEXT) |
200 | 205 | test_ntlm_LDADD = $(LDADD) |
216 | 221 | am__v_at_1 = |
217 | 222 | DEFAULT_INCLUDES = -I.@am__isrc@ |
218 | 223 | depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp |
219 | am__depfiles_maybe = depfiles | |
224 | am__maybe_remake_depfiles = depfiles | |
225 | am__depfiles_remade = ./$(DEPDIR)/smbencrypt.Plo \ | |
226 | ./$(DEPDIR)/smbutil.Plo ./$(DEPDIR)/test_CVE-2019-17455.Po \ | |
227 | ./$(DEPDIR)/test_ntlm.Po | |
220 | 228 | am__mv = mv -f |
221 | 229 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
222 | 230 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
236 | 244 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) |
237 | 245 | am__v_CCLD_0 = @echo " CCLD " $@; |
238 | 246 | am__v_CCLD_1 = |
239 | SOURCES = $(libntlm_la_SOURCES) $(libntlm_impl_la_SOURCES) test_ntlm.c | |
247 | SOURCES = $(libntlm_la_SOURCES) $(libntlm_impl_la_SOURCES) \ | |
248 | test_CVE-2019-17455.c test_ntlm.c | |
240 | 249 | DIST_SOURCES = $(libntlm_la_SOURCES) $(libntlm_impl_la_SOURCES) \ |
241 | test_ntlm.c | |
250 | test_CVE-2019-17455.c test_ntlm.c | |
242 | 251 | RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ |
243 | 252 | ctags-recursive dvi-recursive html-recursive info-recursive \ |
244 | 253 | install-data-recursive install-dvi-recursive \ |
261 | 270 | $(RECURSIVE_CLEAN_TARGETS) \ |
262 | 271 | $(am__extra_recursive_targets) |
263 | 272 | AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ |
264 | cscope check recheck distdir dist dist-all distcheck | |
273 | cscope check recheck distdir distdir-am dist dist-all \ | |
274 | distcheck | |
265 | 275 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ |
266 | 276 | $(LISP)config.h.in |
267 | 277 | # Read a list of newline-separated strings from the standard input, |
551 | 561 | EGREP = @EGREP@ |
552 | 562 | EXEEXT = @EXEEXT@ |
553 | 563 | FGREP = @FGREP@ |
564 | GNULIB_ACCESS = @GNULIB_ACCESS@ | |
554 | 565 | GNULIB_BTOWC = @GNULIB_BTOWC@ |
555 | 566 | GNULIB_CHDIR = @GNULIB_CHDIR@ |
556 | 567 | GNULIB_CHOWN = @GNULIB_CHOWN@ |
557 | 568 | GNULIB_CLOSE = @GNULIB_CLOSE@ |
569 | GNULIB_COPY_FILE_RANGE = @GNULIB_COPY_FILE_RANGE@ | |
558 | 570 | GNULIB_DUP = @GNULIB_DUP@ |
559 | 571 | GNULIB_DUP2 = @GNULIB_DUP2@ |
560 | 572 | GNULIB_DUP3 = @GNULIB_DUP3@ |
576 | 588 | GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ |
577 | 589 | GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ |
578 | 590 | GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ |
591 | GNULIB_GETOPT_POSIX = @GNULIB_GETOPT_POSIX@ | |
579 | 592 | GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ |
580 | 593 | GNULIB_GETPASS = @GNULIB_GETPASS@ |
581 | 594 | GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ |
688 | 701 | HAVE_BTOWC = @HAVE_BTOWC@ |
689 | 702 | HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ |
690 | 703 | HAVE_CHOWN = @HAVE_CHOWN@ |
704 | HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ | |
691 | 705 | HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ |
692 | 706 | HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ |
693 | 707 | HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ |
739 | 753 | HAVE_LCHOWN = @HAVE_LCHOWN@ |
740 | 754 | HAVE_LINK = @HAVE_LINK@ |
741 | 755 | HAVE_LINKAT = @HAVE_LINKAT@ |
742 | HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ | |
743 | 756 | HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ |
744 | 757 | HAVE_MBRLEN = @HAVE_MBRLEN@ |
745 | 758 | HAVE_MBRTOWC = @HAVE_MBRTOWC@ |
778 | 791 | HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ |
779 | 792 | HAVE_UNISTD_H = @HAVE_UNISTD_H@ |
780 | 793 | HAVE_UNLINKAT = @HAVE_UNLINKAT@ |
781 | HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ | |
782 | 794 | HAVE_USLEEP = @HAVE_USLEEP@ |
783 | 795 | HAVE_WCHAR_H = @HAVE_WCHAR_H@ |
784 | 796 | HAVE_WCHAR_T = @HAVE_WCHAR_T@ |
878 | 890 | PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ |
879 | 891 | PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ |
880 | 892 | RANLIB = @RANLIB@ |
893 | REPLACE_ACCESS = @REPLACE_ACCESS@ | |
881 | 894 | REPLACE_BTOWC = @REPLACE_BTOWC@ |
882 | 895 | REPLACE_CHOWN = @REPLACE_CHOWN@ |
883 | 896 | REPLACE_CLOSE = @REPLACE_CLOSE@ |
939 | 952 | REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ |
940 | 953 | REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ |
941 | 954 | REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ |
955 | REPLACE_WCSTOK = @REPLACE_WCSTOK@ | |
942 | 956 | REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ |
943 | 957 | REPLACE_WCTOB = @REPLACE_WCTOB@ |
944 | 958 | REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ |
1043 | 1057 | LDADD = libntlm_impl.la gl/libgnu.la |
1044 | 1058 | CLEANFILES = test.out |
1045 | 1059 | test_ntlm_LDFLAGS = -no-install |
1046 | TESTS_ENVIRONMENT = $(VALGRIND) | |
1060 | LOG_COMPILER = $(VALGRIND) | |
1047 | 1061 | all: config.h |
1048 | 1062 | $(MAKE) $(AM_MAKEFLAGS) all-recursive |
1049 | 1063 | |
1070 | 1084 | echo ' $(SHELL) ./config.status'; \ |
1071 | 1085 | $(SHELL) ./config.status;; \ |
1072 | 1086 | *) \ |
1073 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ | |
1074 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ | |
1087 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ | |
1088 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ | |
1075 | 1089 | esac; |
1076 | 1090 | |
1077 | 1091 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) |
1103 | 1117 | cd $(top_builddir) && $(SHELL) ./config.status $@ |
1104 | 1118 | ntlm.h: $(top_builddir)/config.status $(srcdir)/ntlm.h.in |
1105 | 1119 | cd $(top_builddir) && $(SHELL) ./config.status $@ |
1120 | ||
1121 | clean-checkPROGRAMS: | |
1122 | @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ | |
1123 | echo " rm -f" $$list; \ | |
1124 | rm -f $$list || exit $$?; \ | |
1125 | test -n "$(EXEEXT)" || exit 0; \ | |
1126 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ | |
1127 | echo " rm -f" $$list; \ | |
1128 | rm -f $$list | |
1106 | 1129 | |
1107 | 1130 | install-libLTLIBRARIES: $(lib_LTLIBRARIES) |
1108 | 1131 | @$(NORMAL_INSTALL) |
1156 | 1179 | libntlm_impl.la: $(libntlm_impl_la_OBJECTS) $(libntlm_impl_la_DEPENDENCIES) $(EXTRA_libntlm_impl_la_DEPENDENCIES) |
1157 | 1180 | $(AM_V_CCLD)$(LINK) $(libntlm_impl_la_OBJECTS) $(libntlm_impl_la_LIBADD) $(LIBS) |
1158 | 1181 | |
1159 | clean-checkPROGRAMS: | |
1160 | @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ | |
1161 | echo " rm -f" $$list; \ | |
1162 | rm -f $$list || exit $$?; \ | |
1163 | test -n "$(EXEEXT)" || exit 0; \ | |
1164 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ | |
1165 | echo " rm -f" $$list; \ | |
1166 | rm -f $$list | |
1182 | test_CVE-2019-17455$(EXEEXT): $(test_CVE_2019_17455_OBJECTS) $(test_CVE_2019_17455_DEPENDENCIES) $(EXTRA_test_CVE_2019_17455_DEPENDENCIES) | |
1183 | @rm -f test_CVE-2019-17455$(EXEEXT) | |
1184 | $(AM_V_CCLD)$(LINK) $(test_CVE_2019_17455_OBJECTS) $(test_CVE_2019_17455_LDADD) $(LIBS) | |
1167 | 1185 | |
1168 | 1186 | test_ntlm$(EXEEXT): $(test_ntlm_OBJECTS) $(test_ntlm_DEPENDENCIES) $(EXTRA_test_ntlm_DEPENDENCIES) |
1169 | 1187 | @rm -f test_ntlm$(EXEEXT) |
1175 | 1193 | distclean-compile: |
1176 | 1194 | -rm -f *.tab.c |
1177 | 1195 | |
1178 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smbencrypt.Plo@am__quote@ | |
1179 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smbutil.Plo@am__quote@ | |
1180 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntlm.Po@am__quote@ | |
1196 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smbencrypt.Plo@am__quote@ # am--include-marker | |
1197 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smbutil.Plo@am__quote@ # am--include-marker | |
1198 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_CVE-2019-17455.Po@am__quote@ # am--include-marker | |
1199 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntlm.Po@am__quote@ # am--include-marker | |
1200 | ||
1201 | $(am__depfiles_remade): | |
1202 | @$(MKDIR_P) $(@D) | |
1203 | @echo '# dummy' >$@-t && $(am__mv) $@-t $@ | |
1204 | ||
1205 | am--depfiles: $(am__depfiles_remade) | |
1181 | 1206 | |
1182 | 1207 | .c.o: |
1183 | 1208 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |
1477 | 1502 | fi; \ |
1478 | 1503 | $$success || exit 1 |
1479 | 1504 | |
1480 | check-TESTS: | |
1505 | check-TESTS: $(check_PROGRAMS) | |
1481 | 1506 | @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list |
1482 | 1507 | @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list |
1483 | 1508 | @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) |
1505 | 1530 | --log-file $$b.log --trs-file $$b.trs \ |
1506 | 1531 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ |
1507 | 1532 | "$$tst" $(AM_TESTS_FD_REDIRECT) |
1533 | test_CVE-2019-17455.log: test_CVE-2019-17455$(EXEEXT) | |
1534 | @p='test_CVE-2019-17455$(EXEEXT)'; \ | |
1535 | b='test_CVE-2019-17455'; \ | |
1536 | $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ | |
1537 | --log-file $$b.log --trs-file $$b.trs \ | |
1538 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ | |
1539 | "$$tst" $(AM_TESTS_FD_REDIRECT) | |
1508 | 1540 | .test.log: |
1509 | 1541 | @p='$<'; \ |
1510 | 1542 | $(am__set_b); \ |
1520 | 1552 | @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ |
1521 | 1553 | @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) |
1522 | 1554 | |
1523 | distdir: $(DISTFILES) | |
1555 | distdir: $(BUILT_SOURCES) | |
1556 | $(MAKE) $(AM_MAKEFLAGS) distdir-am | |
1557 | ||
1558 | distdir-am: $(DISTFILES) | |
1524 | 1559 | @case `sed 15q $(srcdir)/NEWS` in \ |
1525 | 1560 | *"$(VERSION)"*) : ;; \ |
1526 | 1561 | *) \ |
1591 | 1626 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ |
1592 | 1627 | || chmod -R a+r "$(distdir)" |
1593 | 1628 | dist-gzip: distdir |
1594 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz | |
1629 | tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz | |
1595 | 1630 | $(am__post_remove_distdir) |
1596 | 1631 | |
1597 | 1632 | dist-bzip2: distdir |
1617 | 1652 | @echo WARNING: "Support for shar distribution archives is" \ |
1618 | 1653 | "deprecated." >&2 |
1619 | 1654 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 |
1620 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz | |
1655 | shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz | |
1621 | 1656 | $(am__post_remove_distdir) |
1622 | 1657 | |
1623 | 1658 | dist-zip: distdir |
1635 | 1670 | distcheck: dist |
1636 | 1671 | case '$(DIST_ARCHIVES)' in \ |
1637 | 1672 | *.tar.gz*) \ |
1638 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ | |
1673 | eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ | |
1639 | 1674 | *.tar.bz2*) \ |
1640 | 1675 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ |
1641 | 1676 | *.tar.lz*) \ |
1645 | 1680 | *.tar.Z*) \ |
1646 | 1681 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ |
1647 | 1682 | *.shar.gz*) \ |
1648 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ | |
1683 | eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ | |
1649 | 1684 | *.zip*) \ |
1650 | 1685 | unzip $(distdir).zip ;;\ |
1651 | 1686 | esac |
1765 | 1800 | |
1766 | 1801 | distclean: distclean-recursive |
1767 | 1802 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) |
1768 | -rm -rf ./$(DEPDIR) | |
1803 | -rm -f ./$(DEPDIR)/smbencrypt.Plo | |
1804 | -rm -f ./$(DEPDIR)/smbutil.Plo | |
1805 | -rm -f ./$(DEPDIR)/test_CVE-2019-17455.Po | |
1806 | -rm -f ./$(DEPDIR)/test_ntlm.Po | |
1769 | 1807 | -rm -f Makefile |
1770 | 1808 | distclean-am: clean-am distclean-compile distclean-generic \ |
1771 | 1809 | distclean-hdr distclean-libtool distclean-tags |
1813 | 1851 | maintainer-clean: maintainer-clean-recursive |
1814 | 1852 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) |
1815 | 1853 | -rm -rf $(top_srcdir)/autom4te.cache |
1816 | -rm -rf ./$(DEPDIR) | |
1854 | -rm -f ./$(DEPDIR)/smbencrypt.Plo | |
1855 | -rm -f ./$(DEPDIR)/smbutil.Plo | |
1856 | -rm -f ./$(DEPDIR)/test_CVE-2019-17455.Po | |
1857 | -rm -f ./$(DEPDIR)/test_ntlm.Po | |
1817 | 1858 | -rm -f Makefile |
1818 | 1859 | maintainer-clean-am: distclean-am maintainer-clean-generic |
1819 | 1860 | |
1836 | 1877 | .MAKE: $(am__recursive_targets) all check-am install-am install-strip |
1837 | 1878 | |
1838 | 1879 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ |
1839 | am--refresh check check-TESTS check-am clean \ | |
1880 | am--depfiles am--refresh check check-TESTS check-am clean \ | |
1840 | 1881 | clean-checkPROGRAMS clean-cscope clean-generic \ |
1841 | 1882 | clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ |
1842 | 1883 | cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ |
0 | 0 | Libntlm NEWS -- history of user-visible changes. -*- outline -*- |
1 | Copyright (C) 2002-2018 Simon Josefsson | |
1 | Copyright (C) 2002-2020 Simon Josefsson | |
2 | 2 | Copyright (C) 1999 Grant Edwards |
3 | 3 | See the end for copying conditions. |
4 | ||
5 | * Version 1.6 (released 2020-04-19) | |
6 | ||
7 | ** Fix buffer overflow in buildSmbNtlmAuth* function. CVE-2019-17455. | |
8 | Reported by Kirin in <https://gitlab.com/jas/libntlm/-/issues/2> and | |
9 | patch provided by Cedric Buissart. See newly introduced regression | |
10 | check test_CVE-2019-17455.c for test of a vulnerable library. | |
11 | ||
12 | ** API and ABI modifications. | |
13 | No changes since last version. | |
4 | 14 | |
5 | 15 | * Version 1.5 (released 2018-08-24) |
6 | 16 |
0 | 0 | Libntlm README -- important introductory notes |
1 | Copyright (C) 2002-2018 Simon Josefsson | |
1 | Copyright (C) 2002-2020 Simon Josefsson | |
2 | 2 | Copyright (C) 1999 Grant Edwards |
3 | 3 | See the end for copying conditions. |
4 | 4 |
0 | 0 | Libntlm THANKS -- acknowledgements |
1 | Copyright (C) 2002-2018 Simon Josefsson | |
1 | Copyright (C) 2002-2020 Simon Josefsson | |
2 | 2 | See the end for copying conditions. |
3 | 3 | |
4 | 4 | Much of the code was originally written by Andrew Tridgell for the |
14 | 14 | Pavel Fedin <fedin@matek.ru> |
15 | 15 | Andrej Kacian <ticho@gentoo.org> |
16 | 16 | Romain GEISSLER <romain.geissler@amadeus.com> |
17 | Kirin | |
18 | Cedric Buissart | |
17 | 19 | |
18 | 20 | ---------------------------------------------------------------------- |
19 | 21 | Copying and distribution of this file, with or without modification, |
0 | # generated automatically by aclocal 1.15 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2014 Free Software Foundation, Inc. | |
0 | # generated automatically by aclocal 1.16.1 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | # This file is free software; the Free Software Foundation |
5 | 5 | # gives unlimited permission to copy and/or distribute it, |
19 | 19 | If you have problems, you may need to regenerate the build system entirely. |
20 | 20 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
21 | 21 | |
22 | # Copyright (C) 2002-2014 Free Software Foundation, Inc. | |
22 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
23 | 23 | # |
24 | 24 | # This file is free software; the Free Software Foundation |
25 | 25 | # gives unlimited permission to copy and/or distribute it, |
31 | 31 | # generated from the m4 files accompanying Automake X.Y. |
32 | 32 | # (This private macro should not be called outside this file.) |
33 | 33 | AC_DEFUN([AM_AUTOMAKE_VERSION], |
34 | [am__api_version='1.15' | |
34 | [am__api_version='1.16' | |
35 | 35 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
36 | 36 | dnl require some minimum version. Point them to the right macro. |
37 | m4_if([$1], [1.15], [], | |
37 | m4_if([$1], [1.16.1], [], | |
38 | 38 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
39 | 39 | ]) |
40 | 40 | |
50 | 50 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
51 | 51 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
52 | 52 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
53 | [AM_AUTOMAKE_VERSION([1.15])dnl | |
53 | [AM_AUTOMAKE_VERSION([1.16.1])dnl | |
54 | 54 | m4_ifndef([AC_AUTOCONF_VERSION], |
55 | 55 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
56 | 56 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
57 | 57 | |
58 | # Copyright (C) 2011-2014 Free Software Foundation, Inc. | |
58 | # Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
59 | 59 | # |
60 | 60 | # This file is free software; the Free Software Foundation |
61 | 61 | # gives unlimited permission to copy and/or distribute it, |
117 | 117 | |
118 | 118 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- |
119 | 119 | |
120 | # Copyright (C) 2001-2014 Free Software Foundation, Inc. | |
120 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
121 | 121 | # |
122 | 122 | # This file is free software; the Free Software Foundation |
123 | 123 | # gives unlimited permission to copy and/or distribute it, |
169 | 169 | |
170 | 170 | # AM_CONDITIONAL -*- Autoconf -*- |
171 | 171 | |
172 | # Copyright (C) 1997-2014 Free Software Foundation, Inc. | |
172 | # Copyright (C) 1997-2018 Free Software Foundation, Inc. | |
173 | 173 | # |
174 | 174 | # This file is free software; the Free Software Foundation |
175 | 175 | # gives unlimited permission to copy and/or distribute it, |
200 | 200 | Usually this means the macro was only invoked conditionally.]]) |
201 | 201 | fi])]) |
202 | 202 | |
203 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. | |
203 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
204 | 204 | # |
205 | 205 | # This file is free software; the Free Software Foundation |
206 | 206 | # gives unlimited permission to copy and/or distribute it, |
391 | 391 | |
392 | 392 | # Generate code to set up dependency tracking. -*- Autoconf -*- |
393 | 393 | |
394 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. | |
395 | # | |
396 | # This file is free software; the Free Software Foundation | |
397 | # gives unlimited permission to copy and/or distribute it, | |
398 | # with or without modifications, as long as this notice is preserved. | |
399 | ||
394 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
395 | # | |
396 | # This file is free software; the Free Software Foundation | |
397 | # gives unlimited permission to copy and/or distribute it, | |
398 | # with or without modifications, as long as this notice is preserved. | |
400 | 399 | |
401 | 400 | # _AM_OUTPUT_DEPENDENCY_COMMANDS |
402 | 401 | # ------------------------------ |
405 | 404 | # Older Autoconf quotes --file arguments for eval, but not when files |
406 | 405 | # are listed without --file. Let's play safe and only enable the eval |
407 | 406 | # if we detect the quoting. |
408 | case $CONFIG_FILES in | |
409 | *\'*) eval set x "$CONFIG_FILES" ;; | |
410 | *) set x $CONFIG_FILES ;; | |
411 | esac | |
407 | # TODO: see whether this extra hack can be removed once we start | |
408 | # requiring Autoconf 2.70 or later. | |
409 | AS_CASE([$CONFIG_FILES], | |
410 | [*\'*], [eval set x "$CONFIG_FILES"], | |
411 | [*], [set x $CONFIG_FILES]) | |
412 | 412 | shift |
413 | for mf | |
413 | # Used to flag and report bootstrapping failures. | |
414 | am_rc=0 | |
415 | for am_mf | |
414 | 416 | do |
415 | 417 | # Strip MF so we end up with the name of the file. |
416 | mf=`echo "$mf" | sed -e 's/:.*$//'` | |
417 | # Check whether this is an Automake generated Makefile or not. | |
418 | # We used to match only the files named 'Makefile.in', but | |
419 | # some people rename them; so instead we look at the file content. | |
420 | # Grep'ing the first line is not enough: some people post-process | |
421 | # each Makefile.in and add a new line on top of each file to say so. | |
422 | # Grep'ing the whole file is not good either: AIX grep has a line | |
418 | am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` | |
419 | # Check whether this is an Automake generated Makefile which includes | |
420 | # dependency-tracking related rules and includes. | |
421 | # Grep'ing the whole file directly is not great: AIX grep has a line | |
423 | 422 | # limit of 2048, but all sed's we know have understand at least 4000. |
424 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then | |
425 | dirpart=`AS_DIRNAME("$mf")` | |
426 | else | |
427 | continue | |
428 | fi | |
429 | # Extract the definition of DEPDIR, am__include, and am__quote | |
430 | # from the Makefile without running 'make'. | |
431 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` | |
432 | test -z "$DEPDIR" && continue | |
433 | am__include=`sed -n 's/^am__include = //p' < "$mf"` | |
434 | test -z "$am__include" && continue | |
435 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` | |
436 | # Find all dependency output files, they are included files with | |
437 | # $(DEPDIR) in their names. We invoke sed twice because it is the | |
438 | # simplest approach to changing $(DEPDIR) to its actual value in the | |
439 | # expansion. | |
440 | for file in `sed -n " | |
441 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ | |
442 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do | |
443 | # Make sure the directory exists. | |
444 | test -f "$dirpart/$file" && continue | |
445 | fdir=`AS_DIRNAME(["$file"])` | |
446 | AS_MKDIR_P([$dirpart/$fdir]) | |
447 | # echo "creating $dirpart/$file" | |
448 | echo '# dummy' > "$dirpart/$file" | |
449 | done | |
423 | sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ | |
424 | || continue | |
425 | am_dirpart=`AS_DIRNAME(["$am_mf"])` | |
426 | am_filepart=`AS_BASENAME(["$am_mf"])` | |
427 | AM_RUN_LOG([cd "$am_dirpart" \ | |
428 | && sed -e '/# am--include-marker/d' "$am_filepart" \ | |
429 | | $MAKE -f - am--depfiles]) || am_rc=$? | |
450 | 430 | done |
431 | if test $am_rc -ne 0; then | |
432 | AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments | |
433 | for automatic dependency tracking. Try re-running configure with the | |
434 | '--disable-dependency-tracking' option to at least be able to build | |
435 | the package (albeit without support for automatic dependency tracking).]) | |
436 | fi | |
437 | AS_UNSET([am_dirpart]) | |
438 | AS_UNSET([am_filepart]) | |
439 | AS_UNSET([am_mf]) | |
440 | AS_UNSET([am_rc]) | |
441 | rm -f conftest-deps.mk | |
451 | 442 | } |
452 | 443 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS |
453 | 444 | |
456 | 447 | # ----------------------------- |
457 | 448 | # This macro should only be invoked once -- use via AC_REQUIRE. |
458 | 449 | # |
459 | # This code is only required when automatic dependency tracking | |
460 | # is enabled. FIXME. This creates each '.P' file that we will | |
461 | # need in order to bootstrap the dependency handling code. | |
450 | # This code is only required when automatic dependency tracking is enabled. | |
451 | # This creates each '.Po' and '.Plo' makefile fragment that we'll need in | |
452 | # order to bootstrap the dependency handling code. | |
462 | 453 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], |
463 | 454 | [AC_CONFIG_COMMANDS([depfiles], |
464 | 455 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], |
465 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) | |
466 | ]) | |
456 | [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) | |
467 | 457 | |
468 | 458 | # Do all the work for Automake. -*- Autoconf -*- |
469 | 459 | |
470 | # Copyright (C) 1996-2014 Free Software Foundation, Inc. | |
460 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
471 | 461 | # |
472 | 462 | # This file is free software; the Free Software Foundation |
473 | 463 | # gives unlimited permission to copy and/or distribute it, |
554 | 544 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl |
555 | 545 | # For better backward compatibility. To be removed once Automake 1.9.x |
556 | 546 | # dies out for good. For more background, see: |
557 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
558 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
547 | # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
548 | # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
559 | 549 | AC_SUBST([mkdir_p], ['$(MKDIR_P)']) |
560 | 550 | # We need awk for the "check" target (and possibly the TAP driver). The |
561 | 551 | # system "awk" is bad on some platforms. |
622 | 612 | Aborting the configuration process, to ensure you take notice of the issue. |
623 | 613 | |
624 | 614 | You can download and install GNU coreutils to get an 'rm' implementation |
625 | that behaves properly: <http://www.gnu.org/software/coreutils/>. | |
615 | that behaves properly: <https://www.gnu.org/software/coreutils/>. | |
626 | 616 | |
627 | 617 | If you want to complete the configuration process using your problematic |
628 | 618 | 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM |
664 | 654 | done |
665 | 655 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
666 | 656 | |
667 | # Copyright (C) 2001-2014 Free Software Foundation, Inc. | |
657 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
668 | 658 | # |
669 | 659 | # This file is free software; the Free Software Foundation |
670 | 660 | # gives unlimited permission to copy and/or distribute it, |
685 | 675 | fi |
686 | 676 | AC_SUBST([install_sh])]) |
687 | 677 | |
688 | # Copyright (C) 2003-2014 Free Software Foundation, Inc. | |
678 | # Copyright (C) 2003-2018 Free Software Foundation, Inc. | |
689 | 679 | # |
690 | 680 | # This file is free software; the Free Software Foundation |
691 | 681 | # gives unlimited permission to copy and/or distribute it, |
706 | 696 | |
707 | 697 | # Check to see how 'make' treats includes. -*- Autoconf -*- |
708 | 698 | |
709 | # Copyright (C) 2001-2014 Free Software Foundation, Inc. | |
699 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
710 | 700 | # |
711 | 701 | # This file is free software; the Free Software Foundation |
712 | 702 | # gives unlimited permission to copy and/or distribute it, |
714 | 704 | |
715 | 705 | # AM_MAKE_INCLUDE() |
716 | 706 | # ----------------- |
717 | # Check to see how make treats includes. | |
707 | # Check whether make has an 'include' directive that can support all | |
708 | # the idioms we need for our automatic dependency tracking code. | |
718 | 709 | AC_DEFUN([AM_MAKE_INCLUDE], |
719 | [am_make=${MAKE-make} | |
720 | cat > confinc << 'END' | |
710 | [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) | |
711 | cat > confinc.mk << 'END' | |
721 | 712 | am__doit: |
722 | @echo this is the am__doit target | |
713 | @echo this is the am__doit target >confinc.out | |
723 | 714 | .PHONY: am__doit |
724 | 715 | END |
725 | # If we don't find an include directive, just comment out the code. | |
726 | AC_MSG_CHECKING([for style of include used by $am_make]) | |
727 | 716 | am__include="#" |
728 | 717 | am__quote= |
729 | _am_result=none | |
730 | # First try GNU make style include. | |
731 | echo "include confinc" > confmf | |
732 | # Ignore all kinds of additional output from 'make'. | |
733 | case `$am_make -s -f confmf 2> /dev/null` in #( | |
734 | *the\ am__doit\ target*) | |
735 | am__include=include | |
736 | am__quote= | |
737 | _am_result=GNU | |
738 | ;; | |
739 | esac | |
740 | # Now try BSD make style include. | |
741 | if test "$am__include" = "#"; then | |
742 | echo '.include "confinc"' > confmf | |
743 | case `$am_make -s -f confmf 2> /dev/null` in #( | |
744 | *the\ am__doit\ target*) | |
745 | am__include=.include | |
746 | am__quote="\"" | |
747 | _am_result=BSD | |
748 | ;; | |
749 | esac | |
750 | fi | |
751 | AC_SUBST([am__include]) | |
752 | AC_SUBST([am__quote]) | |
753 | AC_MSG_RESULT([$_am_result]) | |
754 | rm -f confinc confmf | |
755 | ]) | |
718 | # BSD make does it like this. | |
719 | echo '.include "confinc.mk" # ignored' > confmf.BSD | |
720 | # Other make implementations (GNU, Solaris 10, AIX) do it like this. | |
721 | echo 'include confinc.mk # ignored' > confmf.GNU | |
722 | _am_result=no | |
723 | for s in GNU BSD; do | |
724 | AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) | |
725 | AS_CASE([$?:`cat confinc.out 2>/dev/null`], | |
726 | ['0:this is the am__doit target'], | |
727 | [AS_CASE([$s], | |
728 | [BSD], [am__include='.include' am__quote='"'], | |
729 | [am__include='include' am__quote=''])]) | |
730 | if test "$am__include" != "#"; then | |
731 | _am_result="yes ($s style)" | |
732 | break | |
733 | fi | |
734 | done | |
735 | rm -f confinc.* confmf.* | |
736 | AC_MSG_RESULT([${_am_result}]) | |
737 | AC_SUBST([am__include])]) | |
738 | AC_SUBST([am__quote])]) | |
756 | 739 | |
757 | 740 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
758 | 741 | |
759 | # Copyright (C) 1997-2014 Free Software Foundation, Inc. | |
742 | # Copyright (C) 1997-2018 Free Software Foundation, Inc. | |
760 | 743 | # |
761 | 744 | # This file is free software; the Free Software Foundation |
762 | 745 | # gives unlimited permission to copy and/or distribute it, |
797 | 780 | # Obsolete and "removed" macros, that must however still report explicit |
798 | 781 | # error messages when used, to smooth transition. |
799 | 782 | # |
800 | # Copyright (C) 1996-2014 Free Software Foundation, Inc. | |
783 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
801 | 784 | # |
802 | 785 | # This file is free software; the Free Software Foundation |
803 | 786 | # gives unlimited permission to copy and/or distribute it, |
824 | 807 | |
825 | 808 | # Helper functions for option handling. -*- Autoconf -*- |
826 | 809 | |
827 | # Copyright (C) 2001-2014 Free Software Foundation, Inc. | |
810 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
828 | 811 | # |
829 | 812 | # This file is free software; the Free Software Foundation |
830 | 813 | # gives unlimited permission to copy and/or distribute it, |
853 | 836 | AC_DEFUN([_AM_IF_OPTION], |
854 | 837 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
855 | 838 | |
856 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. | |
839 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
857 | 840 | # |
858 | 841 | # This file is free software; the Free Software Foundation |
859 | 842 | # gives unlimited permission to copy and/or distribute it, |
900 | 883 | # For backward compatibility. |
901 | 884 | AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
902 | 885 | |
903 | # Copyright (C) 2001-2014 Free Software Foundation, Inc. | |
886 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
904 | 887 | # |
905 | 888 | # This file is free software; the Free Software Foundation |
906 | 889 | # gives unlimited permission to copy and/or distribute it, |
919 | 902 | |
920 | 903 | # Check to make sure that the build environment is sane. -*- Autoconf -*- |
921 | 904 | |
922 | # Copyright (C) 1996-2014 Free Software Foundation, Inc. | |
905 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
923 | 906 | # |
924 | 907 | # This file is free software; the Free Software Foundation |
925 | 908 | # gives unlimited permission to copy and/or distribute it, |
1000 | 983 | rm -f conftest.file |
1001 | 984 | ]) |
1002 | 985 | |
1003 | # Copyright (C) 2009-2014 Free Software Foundation, Inc. | |
986 | # Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
1004 | 987 | # |
1005 | 988 | # This file is free software; the Free Software Foundation |
1006 | 989 | # gives unlimited permission to copy and/or distribute it, |
1060 | 1043 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
1061 | 1044 | ]) |
1062 | 1045 | |
1063 | # Copyright (C) 2001-2014 Free Software Foundation, Inc. | |
1046 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
1064 | 1047 | # |
1065 | 1048 | # This file is free software; the Free Software Foundation |
1066 | 1049 | # gives unlimited permission to copy and/or distribute it, |
1088 | 1071 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
1089 | 1072 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
1090 | 1073 | |
1091 | # Copyright (C) 2006-2014 Free Software Foundation, Inc. | |
1074 | # Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
1092 | 1075 | # |
1093 | 1076 | # This file is free software; the Free Software Foundation |
1094 | 1077 | # gives unlimited permission to copy and/or distribute it, |
1107 | 1090 | |
1108 | 1091 | # Check how to create a tarball. -*- Autoconf -*- |
1109 | 1092 | |
1110 | # Copyright (C) 2004-2014 Free Software Foundation, Inc. | |
1093 | # Copyright (C) 2004-2018 Free Software Foundation, Inc. | |
1111 | 1094 | # |
1112 | 1095 | # This file is free software; the Free Software Foundation |
1113 | 1096 | # gives unlimited permission to copy and/or distribute it, |
1239 | 1222 | ]) # _AM_PROG_TAR |
1240 | 1223 | |
1241 | 1224 | m4_include([gl/m4/00gnulib.m4]) |
1225 | m4_include([gl/m4/__inline.m4]) | |
1242 | 1226 | m4_include([gl/m4/absolute-header.m4]) |
1243 | 1227 | m4_include([gl/m4/autobuild.m4]) |
1244 | 1228 | m4_include([gl/m4/byteswap.m4]) |
1251 | 1235 | m4_include([gl/m4/inttypes-pri.m4]) |
1252 | 1236 | m4_include([gl/m4/inttypes.m4]) |
1253 | 1237 | m4_include([gl/m4/limits-h.m4]) |
1254 | m4_include([gl/m4/longlong.m4]) | |
1255 | 1238 | m4_include([gl/m4/manywarnings.m4]) |
1256 | 1239 | m4_include([gl/m4/md4.m4]) |
1257 | 1240 | m4_include([gl/m4/multiarch.m4]) |
1271 | 1254 | m4_include([gl/m4/wchar_h.m4]) |
1272 | 1255 | m4_include([gl/m4/wchar_t.m4]) |
1273 | 1256 | m4_include([gl/m4/wint_t.m4]) |
1257 | m4_include([gl/m4/zzgnulib.m4]) | |
1274 | 1258 | m4_include([m4/libtool.m4]) |
1275 | 1259 | m4_include([m4/ltoptions.m4]) |
1276 | 1260 | m4_include([m4/ltsugar.m4]) |
3 | 3 | me=ar-lib |
4 | 4 | scriptversion=2012-03-01.08; # UTC |
5 | 5 | |
6 | # Copyright (C) 2010-2014 Free Software Foundation, Inc. | |
6 | # Copyright (C) 2010-2018 Free Software Foundation, Inc. | |
7 | 7 | # Written by Peter Rosin <peda@lysator.liu.se>. |
8 | 8 | # |
9 | 9 | # This program is free software; you can redistribute it and/or modify |
17 | 17 | # GNU General Public License for more details. |
18 | 18 | # |
19 | 19 | # You should have received a copy of the GNU General Public License |
20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
21 | 21 | |
22 | 22 | # As a special exception to the GNU General Public License, if you |
23 | 23 | # distribute this file as part of a program that contains a |
0 | 0 | #! /bin/sh |
1 | 1 | # Wrapper for compilers which do not understand '-c -o'. |
2 | 2 | |
3 | scriptversion=2012-10-14.11; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. | |
3 | scriptversion=2018-03-07.03; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
6 | 6 | # Written by Tom Tromey <tromey@cygnus.com>. |
7 | 7 | # |
8 | 8 | # This program is free software; you can redistribute it and/or modify |
16 | 16 | # GNU General Public License for more details. |
17 | 17 | # |
18 | 18 | # You should have received a copy of the GNU General Public License |
19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
20 | 20 | |
21 | 21 | # As a special exception to the GNU General Public License, if you |
22 | 22 | # distribute this file as part of a program that contains a |
254 | 254 | echo "compile $scriptversion" |
255 | 255 | exit $? |
256 | 256 | ;; |
257 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) | |
257 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ | |
258 | icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) | |
258 | 259 | func_cl_wrapper "$@" # Doesn't return... |
259 | 260 | ;; |
260 | 261 | esac |
338 | 339 | # Local Variables: |
339 | 340 | # mode: shell-script |
340 | 341 | # sh-indentation: 2 |
341 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
342 | # eval: (add-hook 'before-save-hook 'time-stamp) | |
342 | 343 | # time-stamp-start: "scriptversion=" |
343 | 344 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
344 | # time-stamp-time-zone: "UTC" | |
345 | # time-stamp-time-zone: "UTC0" | |
345 | 346 | # time-stamp-end: "; # UTC" |
346 | 347 | # End: |
0 | 0 | #! /bin/sh |
1 | 1 | # Attempt to guess a canonical system name. |
2 | # Copyright 1992-2016 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2016-10-02' | |
2 | # Copyright 1992-2018 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2018-02-24' | |
5 | 5 | |
6 | 6 | # This file is free software; you can redistribute it and/or modify it |
7 | 7 | # under the terms of the GNU General Public License as published by |
14 | 14 | # General Public License for more details. |
15 | 15 | # |
16 | 16 | # You should have received a copy of the GNU General Public License |
17 | # along with this program; if not, see <http://www.gnu.org/licenses/>. | |
17 | # along with this program; if not, see <https://www.gnu.org/licenses/>. | |
18 | 18 | # |
19 | 19 | # As a special exception to the GNU General Public License, if you |
20 | 20 | # distribute this file as part of a program that contains a |
26 | 26 | # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. |
27 | 27 | # |
28 | 28 | # You can get the latest version of this script from: |
29 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
29 | # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
30 | 30 | # |
31 | 31 | # Please send patches to <config-patches@gnu.org>. |
32 | 32 | |
38 | 38 | |
39 | 39 | Output the configuration name of the system \`$me' is run on. |
40 | 40 | |
41 | Operation modes: | |
41 | Options: | |
42 | 42 | -h, --help print this help, then exit |
43 | 43 | -t, --time-stamp print date of last modification, then exit |
44 | 44 | -v, --version print version number, then exit |
49 | 49 | GNU config.guess ($timestamp) |
50 | 50 | |
51 | 51 | Originally written by Per Bothner. |
52 | Copyright 1992-2016 Free Software Foundation, Inc. | |
52 | Copyright 1992-2018 Free Software Foundation, Inc. | |
53 | 53 | |
54 | 54 | This is free software; see the source for copying conditions. There is NO |
55 | 55 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
106 | 106 | dummy=$tmp/dummy ; |
107 | 107 | tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; |
108 | 108 | case $CC_FOR_BUILD,$HOST_CC,$CC in |
109 | ,,) echo "int x;" > $dummy.c ; | |
109 | ,,) echo "int x;" > "$dummy.c" ; | |
110 | 110 | for c in cc gcc c89 c99 ; do |
111 | if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then | |
111 | if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then | |
112 | 112 | CC_FOR_BUILD="$c"; break ; |
113 | 113 | fi ; |
114 | 114 | done ; |
131 | 131 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
132 | 132 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown |
133 | 133 | |
134 | case "${UNAME_SYSTEM}" in | |
134 | case "$UNAME_SYSTEM" in | |
135 | 135 | Linux|GNU|GNU/*) |
136 | 136 | # If the system lacks a compiler, then just pick glibc. |
137 | 137 | # We could probably try harder. |
138 | 138 | LIBC=gnu |
139 | 139 | |
140 | eval $set_cc_for_build | |
141 | cat <<-EOF > $dummy.c | |
140 | eval "$set_cc_for_build" | |
141 | cat <<-EOF > "$dummy.c" | |
142 | 142 | #include <features.h> |
143 | 143 | #if defined(__UCLIBC__) |
144 | 144 | LIBC=uclibc |
148 | 148 | LIBC=gnu |
149 | 149 | #endif |
150 | 150 | EOF |
151 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` | |
151 | eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" | |
152 | ||
153 | # If ldd exists, use it to detect musl libc. | |
154 | if command -v ldd >/dev/null && \ | |
155 | ldd --version 2>&1 | grep -q ^musl | |
156 | then | |
157 | LIBC=musl | |
158 | fi | |
152 | 159 | ;; |
153 | 160 | esac |
154 | 161 | |
155 | 162 | # Note: order is significant - the case branches are not exclusive. |
156 | 163 | |
157 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | |
164 | case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in | |
158 | 165 | *:NetBSD:*:*) |
159 | 166 | # NetBSD (nbsd) targets should (where applicable) match one or |
160 | 167 | # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, |
168 | 175 | # portion of the name. We always set it to "unknown". |
169 | 176 | sysctl="sysctl -n hw.machine_arch" |
170 | 177 | UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ |
171 | /sbin/$sysctl 2>/dev/null || \ | |
172 | /usr/sbin/$sysctl 2>/dev/null || \ | |
178 | "/sbin/$sysctl" 2>/dev/null || \ | |
179 | "/usr/sbin/$sysctl" 2>/dev/null || \ | |
173 | 180 | echo unknown)` |
174 | case "${UNAME_MACHINE_ARCH}" in | |
181 | case "$UNAME_MACHINE_ARCH" in | |
175 | 182 | armeb) machine=armeb-unknown ;; |
176 | 183 | arm*) machine=arm-unknown ;; |
177 | 184 | sh3el) machine=shl-unknown ;; |
178 | 185 | sh3eb) machine=sh-unknown ;; |
179 | 186 | sh5el) machine=sh5le-unknown ;; |
180 | 187 | earmv*) |
181 | arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` | |
182 | endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` | |
183 | machine=${arch}${endian}-unknown | |
188 | arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` | |
189 | endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` | |
190 | machine="${arch}${endian}"-unknown | |
184 | 191 | ;; |
185 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; | |
192 | *) machine="$UNAME_MACHINE_ARCH"-unknown ;; | |
186 | 193 | esac |
187 | 194 | # The Operating System including object format, if it has switched |
188 | 195 | # to ELF recently (or will in the future) and ABI. |
189 | case "${UNAME_MACHINE_ARCH}" in | |
196 | case "$UNAME_MACHINE_ARCH" in | |
190 | 197 | earm*) |
191 | 198 | os=netbsdelf |
192 | 199 | ;; |
193 | 200 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) |
194 | eval $set_cc_for_build | |
201 | eval "$set_cc_for_build" | |
195 | 202 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
196 | 203 | | grep -q __ELF__ |
197 | 204 | then |
207 | 214 | ;; |
208 | 215 | esac |
209 | 216 | # Determine ABI tags. |
210 | case "${UNAME_MACHINE_ARCH}" in | |
217 | case "$UNAME_MACHINE_ARCH" in | |
211 | 218 | earm*) |
212 | 219 | expr='s/^earmv[0-9]/-eabi/;s/eb$//' |
213 | abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` | |
220 | abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` | |
214 | 221 | ;; |
215 | 222 | esac |
216 | 223 | # The OS release |
218 | 225 | # thus, need a distinct triplet. However, they do not need |
219 | 226 | # kernel version information, so it can be replaced with a |
220 | 227 | # suitable tag, in the style of linux-gnu. |
221 | case "${UNAME_VERSION}" in | |
228 | case "$UNAME_VERSION" in | |
222 | 229 | Debian*) |
223 | 230 | release='-gnu' |
224 | 231 | ;; |
225 | 232 | *) |
226 | release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` | |
233 | release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` | |
227 | 234 | ;; |
228 | 235 | esac |
229 | 236 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
230 | 237 | # contains redundant information, the shorter form: |
231 | 238 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
232 | echo "${machine}-${os}${release}${abi}" | |
239 | echo "$machine-${os}${release}${abi}" | |
233 | 240 | exit ;; |
234 | 241 | *:Bitrig:*:*) |
235 | 242 | UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` |
236 | echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} | |
243 | echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" | |
237 | 244 | exit ;; |
238 | 245 | *:OpenBSD:*:*) |
239 | 246 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
240 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} | |
247 | echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" | |
241 | 248 | exit ;; |
242 | 249 | *:LibertyBSD:*:*) |
243 | 250 | UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` |
244 | echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} | |
251 | echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" | |
252 | exit ;; | |
253 | *:MidnightBSD:*:*) | |
254 | echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" | |
245 | 255 | exit ;; |
246 | 256 | *:ekkoBSD:*:*) |
247 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} | |
257 | echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" | |
248 | 258 | exit ;; |
249 | 259 | *:SolidBSD:*:*) |
250 | echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} | |
260 | echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" | |
251 | 261 | exit ;; |
252 | 262 | macppc:MirBSD:*:*) |
253 | echo powerpc-unknown-mirbsd${UNAME_RELEASE} | |
263 | echo powerpc-unknown-mirbsd"$UNAME_RELEASE" | |
254 | 264 | exit ;; |
255 | 265 | *:MirBSD:*:*) |
256 | echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} | |
266 | echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" | |
257 | 267 | exit ;; |
258 | 268 | *:Sortix:*:*) |
259 | echo ${UNAME_MACHINE}-unknown-sortix | |
260 | exit ;; | |
269 | echo "$UNAME_MACHINE"-unknown-sortix | |
270 | exit ;; | |
271 | *:Redox:*:*) | |
272 | echo "$UNAME_MACHINE"-unknown-redox | |
273 | exit ;; | |
274 | mips:OSF1:*.*) | |
275 | echo mips-dec-osf1 | |
276 | exit ;; | |
261 | 277 | alpha:OSF1:*:*) |
262 | 278 | case $UNAME_RELEASE in |
263 | 279 | *4.0) |
309 | 325 | # A Tn.n version is a released field test version. |
310 | 326 | # A Xn.n version is an unreleased experimental baselevel. |
311 | 327 | # 1.2 uses "1.2" for uname -r. |
312 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | |
328 | echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" | |
313 | 329 | # Reset EXIT trap before exiting to avoid spurious non-zero exit code. |
314 | 330 | exitcode=$? |
315 | 331 | trap '' 0 |
316 | 332 | exit $exitcode ;; |
317 | Alpha\ *:Windows_NT*:*) | |
318 | # How do we know it's Interix rather than the generic POSIX subsystem? | |
319 | # Should we change UNAME_MACHINE based on the output of uname instead | |
320 | # of the specific Alpha model? | |
321 | echo alpha-pc-interix | |
322 | exit ;; | |
323 | 21064:Windows_NT:50:3) | |
324 | echo alpha-dec-winnt3.5 | |
325 | exit ;; | |
326 | 333 | Amiga*:UNIX_System_V:4.0:*) |
327 | 334 | echo m68k-unknown-sysv4 |
328 | 335 | exit ;; |
329 | 336 | *:[Aa]miga[Oo][Ss]:*:*) |
330 | echo ${UNAME_MACHINE}-unknown-amigaos | |
337 | echo "$UNAME_MACHINE"-unknown-amigaos | |
331 | 338 | exit ;; |
332 | 339 | *:[Mm]orph[Oo][Ss]:*:*) |
333 | echo ${UNAME_MACHINE}-unknown-morphos | |
340 | echo "$UNAME_MACHINE"-unknown-morphos | |
334 | 341 | exit ;; |
335 | 342 | *:OS/390:*:*) |
336 | 343 | echo i370-ibm-openedition |
342 | 349 | echo powerpc-ibm-os400 |
343 | 350 | exit ;; |
344 | 351 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
345 | echo arm-acorn-riscix${UNAME_RELEASE} | |
352 | echo arm-acorn-riscix"$UNAME_RELEASE" | |
346 | 353 | exit ;; |
347 | 354 | arm*:riscos:*:*|arm*:RISCOS:*:*) |
348 | 355 | echo arm-unknown-riscos |
369 | 376 | sparc) echo sparc-icl-nx7; exit ;; |
370 | 377 | esac ;; |
371 | 378 | s390x:SunOS:*:*) |
372 | echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
379 | echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" | |
373 | 380 | exit ;; |
374 | 381 | sun4H:SunOS:5.*:*) |
375 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
382 | echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" | |
376 | 383 | exit ;; |
377 | 384 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) |
378 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
385 | echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" | |
379 | 386 | exit ;; |
380 | 387 | i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) |
381 | echo i386-pc-auroraux${UNAME_RELEASE} | |
388 | echo i386-pc-auroraux"$UNAME_RELEASE" | |
382 | 389 | exit ;; |
383 | 390 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
384 | eval $set_cc_for_build | |
391 | eval "$set_cc_for_build" | |
385 | 392 | SUN_ARCH=i386 |
386 | 393 | # If there is a compiler, see if it is configured for 64-bit objects. |
387 | 394 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. |
394 | 401 | SUN_ARCH=x86_64 |
395 | 402 | fi |
396 | 403 | fi |
397 | echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
404 | echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" | |
398 | 405 | exit ;; |
399 | 406 | sun4*:SunOS:6*:*) |
400 | 407 | # According to config.sub, this is the proper way to canonicalize |
401 | 408 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but |
402 | 409 | # it's likely to be more like Solaris than SunOS4. |
403 | echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
410 | echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" | |
404 | 411 | exit ;; |
405 | 412 | sun4*:SunOS:*:*) |
406 | 413 | case "`/usr/bin/arch -k`" in |
409 | 416 | ;; |
410 | 417 | esac |
411 | 418 | # Japanese Language versions have a version number like `4.1.3-JL'. |
412 | echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` | |
419 | echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" | |
413 | 420 | exit ;; |
414 | 421 | sun3*:SunOS:*:*) |
415 | echo m68k-sun-sunos${UNAME_RELEASE} | |
422 | echo m68k-sun-sunos"$UNAME_RELEASE" | |
416 | 423 | exit ;; |
417 | 424 | sun*:*:4.2BSD:*) |
418 | 425 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` |
419 | test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 | |
426 | test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 | |
420 | 427 | case "`/bin/arch`" in |
421 | 428 | sun3) |
422 | echo m68k-sun-sunos${UNAME_RELEASE} | |
429 | echo m68k-sun-sunos"$UNAME_RELEASE" | |
423 | 430 | ;; |
424 | 431 | sun4) |
425 | echo sparc-sun-sunos${UNAME_RELEASE} | |
432 | echo sparc-sun-sunos"$UNAME_RELEASE" | |
426 | 433 | ;; |
427 | 434 | esac |
428 | 435 | exit ;; |
429 | 436 | aushp:SunOS:*:*) |
430 | echo sparc-auspex-sunos${UNAME_RELEASE} | |
437 | echo sparc-auspex-sunos"$UNAME_RELEASE" | |
431 | 438 | exit ;; |
432 | 439 | # The situation for MiNT is a little confusing. The machine name |
433 | 440 | # can be virtually everything (everything which is not |
438 | 445 | # MiNT. But MiNT is downward compatible to TOS, so this should |
439 | 446 | # be no problem. |
440 | 447 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) |
441 | echo m68k-atari-mint${UNAME_RELEASE} | |
448 | echo m68k-atari-mint"$UNAME_RELEASE" | |
442 | 449 | exit ;; |
443 | 450 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) |
444 | echo m68k-atari-mint${UNAME_RELEASE} | |
451 | echo m68k-atari-mint"$UNAME_RELEASE" | |
445 | 452 | exit ;; |
446 | 453 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) |
447 | echo m68k-atari-mint${UNAME_RELEASE} | |
454 | echo m68k-atari-mint"$UNAME_RELEASE" | |
448 | 455 | exit ;; |
449 | 456 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) |
450 | echo m68k-milan-mint${UNAME_RELEASE} | |
457 | echo m68k-milan-mint"$UNAME_RELEASE" | |
451 | 458 | exit ;; |
452 | 459 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) |
453 | echo m68k-hades-mint${UNAME_RELEASE} | |
460 | echo m68k-hades-mint"$UNAME_RELEASE" | |
454 | 461 | exit ;; |
455 | 462 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) |
456 | echo m68k-unknown-mint${UNAME_RELEASE} | |
463 | echo m68k-unknown-mint"$UNAME_RELEASE" | |
457 | 464 | exit ;; |
458 | 465 | m68k:machten:*:*) |
459 | echo m68k-apple-machten${UNAME_RELEASE} | |
466 | echo m68k-apple-machten"$UNAME_RELEASE" | |
460 | 467 | exit ;; |
461 | 468 | powerpc:machten:*:*) |
462 | echo powerpc-apple-machten${UNAME_RELEASE} | |
469 | echo powerpc-apple-machten"$UNAME_RELEASE" | |
463 | 470 | exit ;; |
464 | 471 | RISC*:Mach:*:*) |
465 | 472 | echo mips-dec-mach_bsd4.3 |
466 | 473 | exit ;; |
467 | 474 | RISC*:ULTRIX:*:*) |
468 | echo mips-dec-ultrix${UNAME_RELEASE} | |
475 | echo mips-dec-ultrix"$UNAME_RELEASE" | |
469 | 476 | exit ;; |
470 | 477 | VAX*:ULTRIX*:*:*) |
471 | echo vax-dec-ultrix${UNAME_RELEASE} | |
478 | echo vax-dec-ultrix"$UNAME_RELEASE" | |
472 | 479 | exit ;; |
473 | 480 | 2020:CLIX:*:* | 2430:CLIX:*:*) |
474 | echo clipper-intergraph-clix${UNAME_RELEASE} | |
481 | echo clipper-intergraph-clix"$UNAME_RELEASE" | |
475 | 482 | exit ;; |
476 | 483 | mips:*:*:UMIPS | mips:*:*:RISCos) |
477 | eval $set_cc_for_build | |
478 | sed 's/^ //' << EOF >$dummy.c | |
484 | eval "$set_cc_for_build" | |
485 | sed 's/^ //' << EOF > "$dummy.c" | |
479 | 486 | #ifdef __cplusplus |
480 | 487 | #include <stdio.h> /* for printf() prototype */ |
481 | 488 | int main (int argc, char *argv[]) { |
484 | 491 | #endif |
485 | 492 | #if defined (host_mips) && defined (MIPSEB) |
486 | 493 | #if defined (SYSTYPE_SYSV) |
487 | printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); | |
494 | printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); | |
488 | 495 | #endif |
489 | 496 | #if defined (SYSTYPE_SVR4) |
490 | printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); | |
497 | printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); | |
491 | 498 | #endif |
492 | 499 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) |
493 | printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); | |
500 | printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); | |
494 | 501 | #endif |
495 | 502 | #endif |
496 | 503 | exit (-1); |
497 | 504 | } |
498 | 505 | EOF |
499 | $CC_FOR_BUILD -o $dummy $dummy.c && | |
500 | dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && | |
501 | SYSTEM_NAME=`$dummy $dummyarg` && | |
506 | $CC_FOR_BUILD -o "$dummy" "$dummy.c" && | |
507 | dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && | |
508 | SYSTEM_NAME=`"$dummy" "$dummyarg"` && | |
502 | 509 | { echo "$SYSTEM_NAME"; exit; } |
503 | echo mips-mips-riscos${UNAME_RELEASE} | |
510 | echo mips-mips-riscos"$UNAME_RELEASE" | |
504 | 511 | exit ;; |
505 | 512 | Motorola:PowerMAX_OS:*:*) |
506 | 513 | echo powerpc-motorola-powermax |
526 | 533 | AViiON:dgux:*:*) |
527 | 534 | # DG/UX returns AViiON for all architectures |
528 | 535 | UNAME_PROCESSOR=`/usr/bin/uname -p` |
529 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] | |
536 | if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] | |
530 | 537 | then |
531 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ | |
532 | [ ${TARGET_BINARY_INTERFACE}x = x ] | |
538 | if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ | |
539 | [ "$TARGET_BINARY_INTERFACE"x = x ] | |
533 | 540 | then |
534 | echo m88k-dg-dgux${UNAME_RELEASE} | |
541 | echo m88k-dg-dgux"$UNAME_RELEASE" | |
535 | 542 | else |
536 | echo m88k-dg-dguxbcs${UNAME_RELEASE} | |
543 | echo m88k-dg-dguxbcs"$UNAME_RELEASE" | |
537 | 544 | fi |
538 | 545 | else |
539 | echo i586-dg-dgux${UNAME_RELEASE} | |
546 | echo i586-dg-dgux"$UNAME_RELEASE" | |
540 | 547 | fi |
541 | 548 | exit ;; |
542 | 549 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) |
553 | 560 | echo m68k-tektronix-bsd |
554 | 561 | exit ;; |
555 | 562 | *:IRIX*:*:*) |
556 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` | |
563 | echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" | |
557 | 564 | exit ;; |
558 | 565 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. |
559 | 566 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id |
565 | 572 | if [ -x /usr/bin/oslevel ] ; then |
566 | 573 | IBM_REV=`/usr/bin/oslevel` |
567 | 574 | else |
568 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | |
569 | fi | |
570 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} | |
575 | IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" | |
576 | fi | |
577 | echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" | |
571 | 578 | exit ;; |
572 | 579 | *:AIX:2:3) |
573 | 580 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then |
574 | eval $set_cc_for_build | |
575 | sed 's/^ //' << EOF >$dummy.c | |
581 | eval "$set_cc_for_build" | |
582 | sed 's/^ //' << EOF > "$dummy.c" | |
576 | 583 | #include <sys/systemcfg.h> |
577 | 584 | |
578 | 585 | main() |
583 | 590 | exit(0); |
584 | 591 | } |
585 | 592 | EOF |
586 | if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` | |
593 | if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` | |
587 | 594 | then |
588 | 595 | echo "$SYSTEM_NAME" |
589 | 596 | else |
597 | 604 | exit ;; |
598 | 605 | *:AIX:*:[4567]) |
599 | 606 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` |
600 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then | |
607 | if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then | |
601 | 608 | IBM_ARCH=rs6000 |
602 | 609 | else |
603 | 610 | IBM_ARCH=powerpc |
606 | 613 | IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | |
607 | 614 | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` |
608 | 615 | else |
609 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | |
610 | fi | |
611 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} | |
616 | IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" | |
617 | fi | |
618 | echo "$IBM_ARCH"-ibm-aix"$IBM_REV" | |
612 | 619 | exit ;; |
613 | 620 | *:AIX:*:*) |
614 | 621 | echo rs6000-ibm-aix |
615 | 622 | exit ;; |
616 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) | |
623 | ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) | |
617 | 624 | echo romp-ibm-bsd4.4 |
618 | 625 | exit ;; |
619 | 626 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and |
620 | echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to | |
627 | echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to | |
621 | 628 | exit ;; # report: romp-ibm BSD 4.3 |
622 | 629 | *:BOSX:*:*) |
623 | 630 | echo rs6000-bull-bosx |
632 | 639 | echo m68k-hp-bsd4.4 |
633 | 640 | exit ;; |
634 | 641 | 9000/[34678]??:HP-UX:*:*) |
635 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | |
636 | case "${UNAME_MACHINE}" in | |
637 | 9000/31? ) HP_ARCH=m68000 ;; | |
638 | 9000/[34]?? ) HP_ARCH=m68k ;; | |
642 | HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` | |
643 | case "$UNAME_MACHINE" in | |
644 | 9000/31?) HP_ARCH=m68000 ;; | |
645 | 9000/[34]??) HP_ARCH=m68k ;; | |
639 | 646 | 9000/[678][0-9][0-9]) |
640 | 647 | if [ -x /usr/bin/getconf ]; then |
641 | 648 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` |
642 | 649 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` |
643 | case "${sc_cpu_version}" in | |
650 | case "$sc_cpu_version" in | |
644 | 651 | 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 |
645 | 652 | 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 |
646 | 653 | 532) # CPU_PA_RISC2_0 |
647 | case "${sc_kernel_bits}" in | |
654 | case "$sc_kernel_bits" in | |
648 | 655 | 32) HP_ARCH=hppa2.0n ;; |
649 | 656 | 64) HP_ARCH=hppa2.0w ;; |
650 | 657 | '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 |
651 | 658 | esac ;; |
652 | 659 | esac |
653 | 660 | fi |
654 | if [ "${HP_ARCH}" = "" ]; then | |
655 | eval $set_cc_for_build | |
656 | sed 's/^ //' << EOF >$dummy.c | |
661 | if [ "$HP_ARCH" = "" ]; then | |
662 | eval "$set_cc_for_build" | |
663 | sed 's/^ //' << EOF > "$dummy.c" | |
657 | 664 | |
658 | 665 | #define _HPUX_SOURCE |
659 | 666 | #include <stdlib.h> |
686 | 693 | exit (0); |
687 | 694 | } |
688 | 695 | EOF |
689 | (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | |
696 | (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` | |
690 | 697 | test -z "$HP_ARCH" && HP_ARCH=hppa |
691 | 698 | fi ;; |
692 | 699 | esac |
693 | if [ ${HP_ARCH} = hppa2.0w ] | |
700 | if [ "$HP_ARCH" = hppa2.0w ] | |
694 | 701 | then |
695 | eval $set_cc_for_build | |
702 | eval "$set_cc_for_build" | |
696 | 703 | |
697 | 704 | # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating |
698 | 705 | # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler |
711 | 718 | HP_ARCH=hppa64 |
712 | 719 | fi |
713 | 720 | fi |
714 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} | |
721 | echo "$HP_ARCH"-hp-hpux"$HPUX_REV" | |
715 | 722 | exit ;; |
716 | 723 | ia64:HP-UX:*:*) |
717 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | |
718 | echo ia64-hp-hpux${HPUX_REV} | |
724 | HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` | |
725 | echo ia64-hp-hpux"$HPUX_REV" | |
719 | 726 | exit ;; |
720 | 727 | 3050*:HI-UX:*:*) |
721 | eval $set_cc_for_build | |
722 | sed 's/^ //' << EOF >$dummy.c | |
728 | eval "$set_cc_for_build" | |
729 | sed 's/^ //' << EOF > "$dummy.c" | |
723 | 730 | #include <unistd.h> |
724 | 731 | int |
725 | 732 | main () |
744 | 751 | exit (0); |
745 | 752 | } |
746 | 753 | EOF |
747 | $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && | |
754 | $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && | |
748 | 755 | { echo "$SYSTEM_NAME"; exit; } |
749 | 756 | echo unknown-hitachi-hiuxwe2 |
750 | 757 | exit ;; |
751 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) | |
758 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) | |
752 | 759 | echo hppa1.1-hp-bsd |
753 | 760 | exit ;; |
754 | 761 | 9000/8??:4.3bsd:*:*) |
757 | 764 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) |
758 | 765 | echo hppa1.0-hp-mpeix |
759 | 766 | exit ;; |
760 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) | |
767 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) | |
761 | 768 | echo hppa1.1-hp-osf |
762 | 769 | exit ;; |
763 | 770 | hp8??:OSF1:*:*) |
765 | 772 | exit ;; |
766 | 773 | i*86:OSF1:*:*) |
767 | 774 | if [ -x /usr/sbin/sysversion ] ; then |
768 | echo ${UNAME_MACHINE}-unknown-osf1mk | |
775 | echo "$UNAME_MACHINE"-unknown-osf1mk | |
769 | 776 | else |
770 | echo ${UNAME_MACHINE}-unknown-osf1 | |
777 | echo "$UNAME_MACHINE"-unknown-osf1 | |
771 | 778 | fi |
772 | 779 | exit ;; |
773 | 780 | parisc*:Lites*:*:*) |
792 | 799 | echo c4-convex-bsd |
793 | 800 | exit ;; |
794 | 801 | CRAY*Y-MP:*:*:*) |
795 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
802 | echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' | |
796 | 803 | exit ;; |
797 | 804 | CRAY*[A-Z]90:*:*:*) |
798 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | |
805 | echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | |
799 | 806 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ |
800 | 807 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ |
801 | 808 | -e 's/\.[^.]*$/.X/' |
802 | 809 | exit ;; |
803 | 810 | CRAY*TS:*:*:*) |
804 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
811 | echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' | |
805 | 812 | exit ;; |
806 | 813 | CRAY*T3E:*:*:*) |
807 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
814 | echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' | |
808 | 815 | exit ;; |
809 | 816 | CRAY*SV1:*:*:*) |
810 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
817 | echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' | |
811 | 818 | exit ;; |
812 | 819 | *:UNICOS/mp:*:*) |
813 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
820 | echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' | |
814 | 821 | exit ;; |
815 | 822 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
816 | 823 | FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` |
817 | 824 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` |
818 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | |
825 | FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` | |
819 | 826 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
820 | 827 | exit ;; |
821 | 828 | 5000:UNIX_System_V:4.*:*) |
822 | 829 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` |
823 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` | |
830 | FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` | |
824 | 831 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
825 | 832 | exit ;; |
826 | 833 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
827 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} | |
834 | echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" | |
828 | 835 | exit ;; |
829 | 836 | sparc*:BSD/OS:*:*) |
830 | echo sparc-unknown-bsdi${UNAME_RELEASE} | |
837 | echo sparc-unknown-bsdi"$UNAME_RELEASE" | |
831 | 838 | exit ;; |
832 | 839 | *:BSD/OS:*:*) |
833 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} | |
840 | echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" | |
834 | 841 | exit ;; |
835 | 842 | *:FreeBSD:*:*) |
836 | 843 | UNAME_PROCESSOR=`/usr/bin/uname -p` |
837 | case ${UNAME_PROCESSOR} in | |
844 | case "$UNAME_PROCESSOR" in | |
838 | 845 | amd64) |
839 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
840 | *) | |
841 | echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
846 | UNAME_PROCESSOR=x86_64 ;; | |
847 | i386) | |
848 | UNAME_PROCESSOR=i586 ;; | |
842 | 849 | esac |
850 | echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" | |
843 | 851 | exit ;; |
844 | 852 | i*:CYGWIN*:*) |
845 | echo ${UNAME_MACHINE}-pc-cygwin | |
853 | echo "$UNAME_MACHINE"-pc-cygwin | |
846 | 854 | exit ;; |
847 | 855 | *:MINGW64*:*) |
848 | echo ${UNAME_MACHINE}-pc-mingw64 | |
856 | echo "$UNAME_MACHINE"-pc-mingw64 | |
849 | 857 | exit ;; |
850 | 858 | *:MINGW*:*) |
851 | echo ${UNAME_MACHINE}-pc-mingw32 | |
859 | echo "$UNAME_MACHINE"-pc-mingw32 | |
852 | 860 | exit ;; |
853 | 861 | *:MSYS*:*) |
854 | echo ${UNAME_MACHINE}-pc-msys | |
855 | exit ;; | |
856 | i*:windows32*:*) | |
857 | # uname -m includes "-pc" on this system. | |
858 | echo ${UNAME_MACHINE}-mingw32 | |
862 | echo "$UNAME_MACHINE"-pc-msys | |
859 | 863 | exit ;; |
860 | 864 | i*:PW*:*) |
861 | echo ${UNAME_MACHINE}-pc-pw32 | |
865 | echo "$UNAME_MACHINE"-pc-pw32 | |
862 | 866 | exit ;; |
863 | 867 | *:Interix*:*) |
864 | case ${UNAME_MACHINE} in | |
868 | case "$UNAME_MACHINE" in | |
865 | 869 | x86) |
866 | echo i586-pc-interix${UNAME_RELEASE} | |
870 | echo i586-pc-interix"$UNAME_RELEASE" | |
867 | 871 | exit ;; |
868 | 872 | authenticamd | genuineintel | EM64T) |
869 | echo x86_64-unknown-interix${UNAME_RELEASE} | |
873 | echo x86_64-unknown-interix"$UNAME_RELEASE" | |
870 | 874 | exit ;; |
871 | 875 | IA64) |
872 | echo ia64-unknown-interix${UNAME_RELEASE} | |
876 | echo ia64-unknown-interix"$UNAME_RELEASE" | |
873 | 877 | exit ;; |
874 | 878 | esac ;; |
875 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) | |
876 | echo i${UNAME_MACHINE}-pc-mks | |
877 | exit ;; | |
878 | 8664:Windows_NT:*) | |
879 | echo x86_64-pc-mks | |
880 | exit ;; | |
881 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) | |
882 | # How do we know it's Interix rather than the generic POSIX subsystem? | |
883 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we | |
884 | # UNAME_MACHINE based on the output of uname instead of i386? | |
885 | echo i586-pc-interix | |
886 | exit ;; | |
887 | 879 | i*:UWIN*:*) |
888 | echo ${UNAME_MACHINE}-pc-uwin | |
880 | echo "$UNAME_MACHINE"-pc-uwin | |
889 | 881 | exit ;; |
890 | 882 | amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) |
891 | 883 | echo x86_64-unknown-cygwin |
892 | 884 | exit ;; |
893 | p*:CYGWIN*:*) | |
894 | echo powerpcle-unknown-cygwin | |
895 | exit ;; | |
896 | 885 | prep*:SunOS:5.*:*) |
897 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
886 | echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" | |
898 | 887 | exit ;; |
899 | 888 | *:GNU:*:*) |
900 | 889 | # the GNU system |
901 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | |
890 | echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" | |
902 | 891 | exit ;; |
903 | 892 | *:GNU/*:*:*) |
904 | 893 | # other systems with GNU libc and userland |
905 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} | |
894 | echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" | |
906 | 895 | exit ;; |
907 | 896 | i*86:Minix:*:*) |
908 | echo ${UNAME_MACHINE}-pc-minix | |
897 | echo "$UNAME_MACHINE"-pc-minix | |
909 | 898 | exit ;; |
910 | 899 | aarch64:Linux:*:*) |
911 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
900 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
912 | 901 | exit ;; |
913 | 902 | aarch64_be:Linux:*:*) |
914 | 903 | UNAME_MACHINE=aarch64_be |
915 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
904 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
916 | 905 | exit ;; |
917 | 906 | alpha:Linux:*:*) |
918 | 907 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
926 | 915 | esac |
927 | 916 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
928 | 917 | if test "$?" = 0 ; then LIBC=gnulibc1 ; fi |
929 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
918 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
930 | 919 | exit ;; |
931 | 920 | arc:Linux:*:* | arceb:Linux:*:*) |
932 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
921 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
933 | 922 | exit ;; |
934 | 923 | arm*:Linux:*:*) |
935 | eval $set_cc_for_build | |
924 | eval "$set_cc_for_build" | |
936 | 925 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
937 | 926 | | grep -q __ARM_EABI__ |
938 | 927 | then |
939 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
928 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
940 | 929 | else |
941 | 930 | if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ |
942 | 931 | | grep -q __ARM_PCS_VFP |
943 | 932 | then |
944 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi | |
933 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi | |
945 | 934 | else |
946 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf | |
935 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf | |
947 | 936 | fi |
948 | 937 | fi |
949 | 938 | exit ;; |
950 | 939 | avr32*:Linux:*:*) |
951 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
940 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
952 | 941 | exit ;; |
953 | 942 | cris:Linux:*:*) |
954 | echo ${UNAME_MACHINE}-axis-linux-${LIBC} | |
943 | echo "$UNAME_MACHINE"-axis-linux-"$LIBC" | |
955 | 944 | exit ;; |
956 | 945 | crisv32:Linux:*:*) |
957 | echo ${UNAME_MACHINE}-axis-linux-${LIBC} | |
946 | echo "$UNAME_MACHINE"-axis-linux-"$LIBC" | |
958 | 947 | exit ;; |
959 | 948 | e2k:Linux:*:*) |
960 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
949 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
961 | 950 | exit ;; |
962 | 951 | frv:Linux:*:*) |
963 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
952 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
964 | 953 | exit ;; |
965 | 954 | hexagon:Linux:*:*) |
966 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
955 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
967 | 956 | exit ;; |
968 | 957 | i*86:Linux:*:*) |
969 | echo ${UNAME_MACHINE}-pc-linux-${LIBC} | |
958 | echo "$UNAME_MACHINE"-pc-linux-"$LIBC" | |
970 | 959 | exit ;; |
971 | 960 | ia64:Linux:*:*) |
972 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
961 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
973 | 962 | exit ;; |
974 | 963 | k1om:Linux:*:*) |
975 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
964 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
976 | 965 | exit ;; |
977 | 966 | m32r*:Linux:*:*) |
978 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
967 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
979 | 968 | exit ;; |
980 | 969 | m68*:Linux:*:*) |
981 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
970 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
982 | 971 | exit ;; |
983 | 972 | mips:Linux:*:* | mips64:Linux:*:*) |
984 | eval $set_cc_for_build | |
985 | sed 's/^ //' << EOF >$dummy.c | |
973 | eval "$set_cc_for_build" | |
974 | sed 's/^ //' << EOF > "$dummy.c" | |
986 | 975 | #undef CPU |
987 | 976 | #undef ${UNAME_MACHINE} |
988 | 977 | #undef ${UNAME_MACHINE}el |
996 | 985 | #endif |
997 | 986 | #endif |
998 | 987 | EOF |
999 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` | |
1000 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } | |
988 | eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" | |
989 | test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } | |
1001 | 990 | ;; |
1002 | 991 | mips64el:Linux:*:*) |
1003 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
992 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1004 | 993 | exit ;; |
1005 | 994 | openrisc*:Linux:*:*) |
1006 | echo or1k-unknown-linux-${LIBC} | |
995 | echo or1k-unknown-linux-"$LIBC" | |
1007 | 996 | exit ;; |
1008 | 997 | or32:Linux:*:* | or1k*:Linux:*:*) |
1009 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
998 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1010 | 999 | exit ;; |
1011 | 1000 | padre:Linux:*:*) |
1012 | echo sparc-unknown-linux-${LIBC} | |
1001 | echo sparc-unknown-linux-"$LIBC" | |
1013 | 1002 | exit ;; |
1014 | 1003 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
1015 | echo hppa64-unknown-linux-${LIBC} | |
1004 | echo hppa64-unknown-linux-"$LIBC" | |
1016 | 1005 | exit ;; |
1017 | 1006 | parisc:Linux:*:* | hppa:Linux:*:*) |
1018 | 1007 | # Look for CPU level |
1019 | 1008 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
1020 | PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; | |
1021 | PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; | |
1022 | *) echo hppa-unknown-linux-${LIBC} ;; | |
1009 | PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; | |
1010 | PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; | |
1011 | *) echo hppa-unknown-linux-"$LIBC" ;; | |
1023 | 1012 | esac |
1024 | 1013 | exit ;; |
1025 | 1014 | ppc64:Linux:*:*) |
1026 | echo powerpc64-unknown-linux-${LIBC} | |
1015 | echo powerpc64-unknown-linux-"$LIBC" | |
1027 | 1016 | exit ;; |
1028 | 1017 | ppc:Linux:*:*) |
1029 | echo powerpc-unknown-linux-${LIBC} | |
1018 | echo powerpc-unknown-linux-"$LIBC" | |
1030 | 1019 | exit ;; |
1031 | 1020 | ppc64le:Linux:*:*) |
1032 | echo powerpc64le-unknown-linux-${LIBC} | |
1021 | echo powerpc64le-unknown-linux-"$LIBC" | |
1033 | 1022 | exit ;; |
1034 | 1023 | ppcle:Linux:*:*) |
1035 | echo powerpcle-unknown-linux-${LIBC} | |
1024 | echo powerpcle-unknown-linux-"$LIBC" | |
1036 | 1025 | exit ;; |
1037 | 1026 | riscv32:Linux:*:* | riscv64:Linux:*:*) |
1038 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1027 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1039 | 1028 | exit ;; |
1040 | 1029 | s390:Linux:*:* | s390x:Linux:*:*) |
1041 | echo ${UNAME_MACHINE}-ibm-linux-${LIBC} | |
1030 | echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" | |
1042 | 1031 | exit ;; |
1043 | 1032 | sh64*:Linux:*:*) |
1044 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1033 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1045 | 1034 | exit ;; |
1046 | 1035 | sh*:Linux:*:*) |
1047 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1036 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1048 | 1037 | exit ;; |
1049 | 1038 | sparc:Linux:*:* | sparc64:Linux:*:*) |
1050 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1039 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1051 | 1040 | exit ;; |
1052 | 1041 | tile*:Linux:*:*) |
1053 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1042 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1054 | 1043 | exit ;; |
1055 | 1044 | vax:Linux:*:*) |
1056 | echo ${UNAME_MACHINE}-dec-linux-${LIBC} | |
1045 | echo "$UNAME_MACHINE"-dec-linux-"$LIBC" | |
1057 | 1046 | exit ;; |
1058 | 1047 | x86_64:Linux:*:*) |
1059 | echo ${UNAME_MACHINE}-pc-linux-${LIBC} | |
1048 | if objdump -f /bin/sh | grep -q elf32-x86-64; then | |
1049 | echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 | |
1050 | else | |
1051 | echo "$UNAME_MACHINE"-pc-linux-"$LIBC" | |
1052 | fi | |
1060 | 1053 | exit ;; |
1061 | 1054 | xtensa*:Linux:*:*) |
1062 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1055 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | |
1063 | 1056 | exit ;; |
1064 | 1057 | i*86:DYNIX/ptx:4*:*) |
1065 | 1058 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
1073 | 1066 | # I am not positive that other SVR4 systems won't match this, |
1074 | 1067 | # I just have to hope. -- rms. |
1075 | 1068 | # Use sysv4.2uw... so that sysv4* matches it. |
1076 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} | |
1069 | echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" | |
1077 | 1070 | exit ;; |
1078 | 1071 | i*86:OS/2:*:*) |
1079 | 1072 | # If we were able to find `uname', then EMX Unix compatibility |
1080 | 1073 | # is probably installed. |
1081 | echo ${UNAME_MACHINE}-pc-os2-emx | |
1074 | echo "$UNAME_MACHINE"-pc-os2-emx | |
1082 | 1075 | exit ;; |
1083 | 1076 | i*86:XTS-300:*:STOP) |
1084 | echo ${UNAME_MACHINE}-unknown-stop | |
1077 | echo "$UNAME_MACHINE"-unknown-stop | |
1085 | 1078 | exit ;; |
1086 | 1079 | i*86:atheos:*:*) |
1087 | echo ${UNAME_MACHINE}-unknown-atheos | |
1080 | echo "$UNAME_MACHINE"-unknown-atheos | |
1088 | 1081 | exit ;; |
1089 | 1082 | i*86:syllable:*:*) |
1090 | echo ${UNAME_MACHINE}-pc-syllable | |
1083 | echo "$UNAME_MACHINE"-pc-syllable | |
1091 | 1084 | exit ;; |
1092 | 1085 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) |
1093 | echo i386-unknown-lynxos${UNAME_RELEASE} | |
1086 | echo i386-unknown-lynxos"$UNAME_RELEASE" | |
1094 | 1087 | exit ;; |
1095 | 1088 | i*86:*DOS:*:*) |
1096 | echo ${UNAME_MACHINE}-pc-msdosdjgpp | |
1097 | exit ;; | |
1098 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) | |
1099 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` | |
1089 | echo "$UNAME_MACHINE"-pc-msdosdjgpp | |
1090 | exit ;; | |
1091 | i*86:*:4.*:*) | |
1092 | UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` | |
1100 | 1093 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then |
1101 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} | |
1094 | echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" | |
1102 | 1095 | else |
1103 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} | |
1096 | echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" | |
1104 | 1097 | fi |
1105 | 1098 | exit ;; |
1106 | 1099 | i*86:*:5:[678]*) |
1110 | 1103 | *Pentium) UNAME_MACHINE=i586 ;; |
1111 | 1104 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
1112 | 1105 | esac |
1113 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} | |
1106 | echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" | |
1114 | 1107 | exit ;; |
1115 | 1108 | i*86:*:3.2:*) |
1116 | 1109 | if test -f /usr/options/cb.name; then |
1117 | 1110 | UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` |
1118 | echo ${UNAME_MACHINE}-pc-isc$UNAME_REL | |
1111 | echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL" | |
1119 | 1112 | elif /bin/uname -X 2>/dev/null >/dev/null ; then |
1120 | 1113 | UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` |
1121 | 1114 | (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 |
1125 | 1118 | && UNAME_MACHINE=i686 |
1126 | 1119 | (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ |
1127 | 1120 | && UNAME_MACHINE=i686 |
1128 | echo ${UNAME_MACHINE}-pc-sco$UNAME_REL | |
1121 | echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" | |
1129 | 1122 | else |
1130 | echo ${UNAME_MACHINE}-pc-sysv32 | |
1123 | echo "$UNAME_MACHINE"-pc-sysv32 | |
1131 | 1124 | fi |
1132 | 1125 | exit ;; |
1133 | 1126 | pc:*:*:*) |
1147 | 1140 | exit ;; |
1148 | 1141 | i860:*:4.*:*) # i860-SVR4 |
1149 | 1142 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then |
1150 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 | |
1143 | echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 | |
1151 | 1144 | else # Add other i860-SVR4 vendors below as they are discovered. |
1152 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 | |
1145 | echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 | |
1153 | 1146 | fi |
1154 | 1147 | exit ;; |
1155 | 1148 | mini*:CTIX:SYS*5:*) |
1169 | 1162 | test -r /etc/.relid \ |
1170 | 1163 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
1171 | 1164 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
1172 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } | |
1165 | && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } | |
1173 | 1166 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ |
1174 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; | |
1167 | && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; | |
1175 | 1168 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) |
1176 | 1169 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
1177 | 1170 | && { echo i486-ncr-sysv4; exit; } ;; |
1180 | 1173 | test -r /etc/.relid \ |
1181 | 1174 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
1182 | 1175 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
1183 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } | |
1176 | && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } | |
1184 | 1177 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ |
1185 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } | |
1178 | && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } | |
1186 | 1179 | /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ |
1187 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; | |
1180 | && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; | |
1188 | 1181 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) |
1189 | echo m68k-unknown-lynxos${UNAME_RELEASE} | |
1182 | echo m68k-unknown-lynxos"$UNAME_RELEASE" | |
1190 | 1183 | exit ;; |
1191 | 1184 | mc68030:UNIX_System_V:4.*:*) |
1192 | 1185 | echo m68k-atari-sysv4 |
1193 | 1186 | exit ;; |
1194 | 1187 | TSUNAMI:LynxOS:2.*:*) |
1195 | echo sparc-unknown-lynxos${UNAME_RELEASE} | |
1188 | echo sparc-unknown-lynxos"$UNAME_RELEASE" | |
1196 | 1189 | exit ;; |
1197 | 1190 | rs6000:LynxOS:2.*:*) |
1198 | echo rs6000-unknown-lynxos${UNAME_RELEASE} | |
1191 | echo rs6000-unknown-lynxos"$UNAME_RELEASE" | |
1199 | 1192 | exit ;; |
1200 | 1193 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) |
1201 | echo powerpc-unknown-lynxos${UNAME_RELEASE} | |
1194 | echo powerpc-unknown-lynxos"$UNAME_RELEASE" | |
1202 | 1195 | exit ;; |
1203 | 1196 | SM[BE]S:UNIX_SV:*:*) |
1204 | echo mips-dde-sysv${UNAME_RELEASE} | |
1197 | echo mips-dde-sysv"$UNAME_RELEASE" | |
1205 | 1198 | exit ;; |
1206 | 1199 | RM*:ReliantUNIX-*:*:*) |
1207 | 1200 | echo mips-sni-sysv4 |
1212 | 1205 | *:SINIX-*:*:*) |
1213 | 1206 | if uname -p 2>/dev/null >/dev/null ; then |
1214 | 1207 | UNAME_MACHINE=`(uname -p) 2>/dev/null` |
1215 | echo ${UNAME_MACHINE}-sni-sysv4 | |
1208 | echo "$UNAME_MACHINE"-sni-sysv4 | |
1216 | 1209 | else |
1217 | 1210 | echo ns32k-sni-sysv |
1218 | 1211 | fi |
1232 | 1225 | exit ;; |
1233 | 1226 | i*86:VOS:*:*) |
1234 | 1227 | # From Paul.Green@stratus.com. |
1235 | echo ${UNAME_MACHINE}-stratus-vos | |
1228 | echo "$UNAME_MACHINE"-stratus-vos | |
1236 | 1229 | exit ;; |
1237 | 1230 | *:VOS:*:*) |
1238 | 1231 | # From Paul.Green@stratus.com. |
1239 | 1232 | echo hppa1.1-stratus-vos |
1240 | 1233 | exit ;; |
1241 | 1234 | mc68*:A/UX:*:*) |
1242 | echo m68k-apple-aux${UNAME_RELEASE} | |
1235 | echo m68k-apple-aux"$UNAME_RELEASE" | |
1243 | 1236 | exit ;; |
1244 | 1237 | news*:NEWS-OS:6*:*) |
1245 | 1238 | echo mips-sony-newsos6 |
1246 | 1239 | exit ;; |
1247 | 1240 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) |
1248 | 1241 | if [ -d /usr/nec ]; then |
1249 | echo mips-nec-sysv${UNAME_RELEASE} | |
1242 | echo mips-nec-sysv"$UNAME_RELEASE" | |
1250 | 1243 | else |
1251 | echo mips-unknown-sysv${UNAME_RELEASE} | |
1244 | echo mips-unknown-sysv"$UNAME_RELEASE" | |
1252 | 1245 | fi |
1253 | 1246 | exit ;; |
1254 | 1247 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. |
1267 | 1260 | echo x86_64-unknown-haiku |
1268 | 1261 | exit ;; |
1269 | 1262 | SX-4:SUPER-UX:*:*) |
1270 | echo sx4-nec-superux${UNAME_RELEASE} | |
1263 | echo sx4-nec-superux"$UNAME_RELEASE" | |
1271 | 1264 | exit ;; |
1272 | 1265 | SX-5:SUPER-UX:*:*) |
1273 | echo sx5-nec-superux${UNAME_RELEASE} | |
1266 | echo sx5-nec-superux"$UNAME_RELEASE" | |
1274 | 1267 | exit ;; |
1275 | 1268 | SX-6:SUPER-UX:*:*) |
1276 | echo sx6-nec-superux${UNAME_RELEASE} | |
1269 | echo sx6-nec-superux"$UNAME_RELEASE" | |
1277 | 1270 | exit ;; |
1278 | 1271 | SX-7:SUPER-UX:*:*) |
1279 | echo sx7-nec-superux${UNAME_RELEASE} | |
1272 | echo sx7-nec-superux"$UNAME_RELEASE" | |
1280 | 1273 | exit ;; |
1281 | 1274 | SX-8:SUPER-UX:*:*) |
1282 | echo sx8-nec-superux${UNAME_RELEASE} | |
1275 | echo sx8-nec-superux"$UNAME_RELEASE" | |
1283 | 1276 | exit ;; |
1284 | 1277 | SX-8R:SUPER-UX:*:*) |
1285 | echo sx8r-nec-superux${UNAME_RELEASE} | |
1278 | echo sx8r-nec-superux"$UNAME_RELEASE" | |
1286 | 1279 | exit ;; |
1287 | 1280 | SX-ACE:SUPER-UX:*:*) |
1288 | echo sxace-nec-superux${UNAME_RELEASE} | |
1281 | echo sxace-nec-superux"$UNAME_RELEASE" | |
1289 | 1282 | exit ;; |
1290 | 1283 | Power*:Rhapsody:*:*) |
1291 | echo powerpc-apple-rhapsody${UNAME_RELEASE} | |
1284 | echo powerpc-apple-rhapsody"$UNAME_RELEASE" | |
1292 | 1285 | exit ;; |
1293 | 1286 | *:Rhapsody:*:*) |
1294 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} | |
1287 | echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" | |
1295 | 1288 | exit ;; |
1296 | 1289 | *:Darwin:*:*) |
1297 | 1290 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
1298 | eval $set_cc_for_build | |
1291 | eval "$set_cc_for_build" | |
1299 | 1292 | if test "$UNAME_PROCESSOR" = unknown ; then |
1300 | 1293 | UNAME_PROCESSOR=powerpc |
1301 | 1294 | fi |
1302 | if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then | |
1295 | if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then | |
1303 | 1296 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then |
1304 | 1297 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
1305 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1306 | grep IS_64BIT_ARCH >/dev/null | |
1298 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1299 | grep IS_64BIT_ARCH >/dev/null | |
1307 | 1300 | then |
1308 | 1301 | case $UNAME_PROCESSOR in |
1309 | 1302 | i386) UNAME_PROCESSOR=x86_64 ;; |
1310 | 1303 | powerpc) UNAME_PROCESSOR=powerpc64 ;; |
1311 | 1304 | esac |
1305 | fi | |
1306 | # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc | |
1307 | if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ | |
1308 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1309 | grep IS_PPC >/dev/null | |
1310 | then | |
1311 | UNAME_PROCESSOR=powerpc | |
1312 | 1312 | fi |
1313 | 1313 | fi |
1314 | 1314 | elif test "$UNAME_PROCESSOR" = i386 ; then |
1320 | 1320 | # that Apple uses in portable devices. |
1321 | 1321 | UNAME_PROCESSOR=x86_64 |
1322 | 1322 | fi |
1323 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} | |
1323 | echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" | |
1324 | 1324 | exit ;; |
1325 | 1325 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
1326 | 1326 | UNAME_PROCESSOR=`uname -p` |
1328 | 1328 | UNAME_PROCESSOR=i386 |
1329 | 1329 | UNAME_MACHINE=pc |
1330 | 1330 | fi |
1331 | echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} | |
1331 | echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" | |
1332 | 1332 | exit ;; |
1333 | 1333 | *:QNX:*:4*) |
1334 | 1334 | echo i386-pc-qnx |
1335 | 1335 | exit ;; |
1336 | NEO-?:NONSTOP_KERNEL:*:*) | |
1337 | echo neo-tandem-nsk${UNAME_RELEASE} | |
1336 | NEO-*:NONSTOP_KERNEL:*:*) | |
1337 | echo neo-tandem-nsk"$UNAME_RELEASE" | |
1338 | 1338 | exit ;; |
1339 | 1339 | NSE-*:NONSTOP_KERNEL:*:*) |
1340 | echo nse-tandem-nsk${UNAME_RELEASE} | |
1341 | exit ;; | |
1342 | NSR-?:NONSTOP_KERNEL:*:*) | |
1343 | echo nsr-tandem-nsk${UNAME_RELEASE} | |
1340 | echo nse-tandem-nsk"$UNAME_RELEASE" | |
1341 | exit ;; | |
1342 | NSR-*:NONSTOP_KERNEL:*:*) | |
1343 | echo nsr-tandem-nsk"$UNAME_RELEASE" | |
1344 | exit ;; | |
1345 | NSV-*:NONSTOP_KERNEL:*:*) | |
1346 | echo nsv-tandem-nsk"$UNAME_RELEASE" | |
1347 | exit ;; | |
1348 | NSX-*:NONSTOP_KERNEL:*:*) | |
1349 | echo nsx-tandem-nsk"$UNAME_RELEASE" | |
1344 | 1350 | exit ;; |
1345 | 1351 | *:NonStop-UX:*:*) |
1346 | 1352 | echo mips-compaq-nonstopux |
1349 | 1355 | echo bs2000-siemens-sysv |
1350 | 1356 | exit ;; |
1351 | 1357 | DS/*:UNIX_System_V:*:*) |
1352 | echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} | |
1358 | echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" | |
1353 | 1359 | exit ;; |
1354 | 1360 | *:Plan9:*:*) |
1355 | 1361 | # "uname -m" is not consistent, so use $cputype instead. 386 |
1360 | 1366 | else |
1361 | 1367 | UNAME_MACHINE="$cputype" |
1362 | 1368 | fi |
1363 | echo ${UNAME_MACHINE}-unknown-plan9 | |
1369 | echo "$UNAME_MACHINE"-unknown-plan9 | |
1364 | 1370 | exit ;; |
1365 | 1371 | *:TOPS-10:*:*) |
1366 | 1372 | echo pdp10-unknown-tops10 |
1381 | 1387 | echo pdp10-unknown-its |
1382 | 1388 | exit ;; |
1383 | 1389 | SEI:*:*:SEIUX) |
1384 | echo mips-sei-seiux${UNAME_RELEASE} | |
1390 | echo mips-sei-seiux"$UNAME_RELEASE" | |
1385 | 1391 | exit ;; |
1386 | 1392 | *:DragonFly:*:*) |
1387 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` | |
1393 | echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" | |
1388 | 1394 | exit ;; |
1389 | 1395 | *:*VMS:*:*) |
1390 | 1396 | UNAME_MACHINE=`(uname -p) 2>/dev/null` |
1391 | case "${UNAME_MACHINE}" in | |
1397 | case "$UNAME_MACHINE" in | |
1392 | 1398 | A*) echo alpha-dec-vms ; exit ;; |
1393 | 1399 | I*) echo ia64-dec-vms ; exit ;; |
1394 | 1400 | V*) echo vax-dec-vms ; exit ;; |
1397 | 1403 | echo i386-pc-xenix |
1398 | 1404 | exit ;; |
1399 | 1405 | i*86:skyos:*:*) |
1400 | echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` | |
1406 | echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" | |
1401 | 1407 | exit ;; |
1402 | 1408 | i*86:rdos:*:*) |
1403 | echo ${UNAME_MACHINE}-pc-rdos | |
1409 | echo "$UNAME_MACHINE"-pc-rdos | |
1404 | 1410 | exit ;; |
1405 | 1411 | i*86:AROS:*:*) |
1406 | echo ${UNAME_MACHINE}-pc-aros | |
1412 | echo "$UNAME_MACHINE"-pc-aros | |
1407 | 1413 | exit ;; |
1408 | 1414 | x86_64:VMkernel:*:*) |
1409 | echo ${UNAME_MACHINE}-unknown-esx | |
1415 | echo "$UNAME_MACHINE"-unknown-esx | |
1410 | 1416 | exit ;; |
1411 | 1417 | amd64:Isilon\ OneFS:*:*) |
1412 | 1418 | echo x86_64-unknown-onefs |
1413 | 1419 | exit ;; |
1414 | 1420 | esac |
1415 | 1421 | |
1422 | echo "$0: unable to guess system type" >&2 | |
1423 | ||
1424 | case "$UNAME_MACHINE:$UNAME_SYSTEM" in | |
1425 | mips:Linux | mips64:Linux) | |
1426 | # If we got here on MIPS GNU/Linux, output extra information. | |
1427 | cat >&2 <<EOF | |
1428 | ||
1429 | NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize | |
1430 | the system type. Please install a C compiler and try again. | |
1431 | EOF | |
1432 | ;; | |
1433 | esac | |
1434 | ||
1416 | 1435 | cat >&2 <<EOF |
1417 | $0: unable to guess system type | |
1418 | 1436 | |
1419 | 1437 | This script (version $timestamp), has failed to recognize the |
1420 | operating system you are using. If your script is old, overwrite | |
1421 | config.guess and config.sub with the latest versions from: | |
1422 | ||
1423 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
1438 | operating system you are using. If your script is old, overwrite *all* | |
1439 | copies of config.guess and config.sub with the latest versions from: | |
1440 | ||
1441 | https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
1424 | 1442 | and |
1425 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
1443 | https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
1426 | 1444 | |
1427 | 1445 | If $0 has already been updated, send the following data and any |
1428 | 1446 | information you think might be pertinent to config-patches@gnu.org to |
1445 | 1463 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` |
1446 | 1464 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` |
1447 | 1465 | |
1448 | UNAME_MACHINE = ${UNAME_MACHINE} | |
1449 | UNAME_RELEASE = ${UNAME_RELEASE} | |
1450 | UNAME_SYSTEM = ${UNAME_SYSTEM} | |
1451 | UNAME_VERSION = ${UNAME_VERSION} | |
1466 | UNAME_MACHINE = "$UNAME_MACHINE" | |
1467 | UNAME_RELEASE = "$UNAME_RELEASE" | |
1468 | UNAME_SYSTEM = "$UNAME_SYSTEM" | |
1469 | UNAME_VERSION = "$UNAME_VERSION" | |
1452 | 1470 | EOF |
1453 | 1471 | |
1454 | 1472 | exit 1 |
1455 | 1473 | |
1456 | 1474 | # Local variables: |
1457 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
1475 | # eval: (add-hook 'write-file-functions 'time-stamp) | |
1458 | 1476 | # time-stamp-start: "timestamp='" |
1459 | 1477 | # time-stamp-format: "%:y-%02m-%02d" |
1460 | 1478 | # time-stamp-end: "'" |
0 | 0 | #! /bin/sh |
1 | 1 | # Configuration validation subroutine script. |
2 | # Copyright 1992-2016 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2016-11-04' | |
2 | # Copyright 1992-2018 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2018-02-22' | |
5 | 5 | |
6 | 6 | # This file is free software; you can redistribute it and/or modify it |
7 | 7 | # under the terms of the GNU General Public License as published by |
14 | 14 | # General Public License for more details. |
15 | 15 | # |
16 | 16 | # You should have received a copy of the GNU General Public License |
17 | # along with this program; if not, see <http://www.gnu.org/licenses/>. | |
17 | # along with this program; if not, see <https://www.gnu.org/licenses/>. | |
18 | 18 | # |
19 | 19 | # As a special exception to the GNU General Public License, if you |
20 | 20 | # distribute this file as part of a program that contains a |
32 | 32 | # Otherwise, we print the canonical config type on stdout and succeed. |
33 | 33 | |
34 | 34 | # You can get the latest version of this script from: |
35 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
35 | # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
36 | 36 | |
37 | 37 | # This file is supposed to be the same for all GNU packages |
38 | 38 | # and recognize all the CPU types, system types and aliases |
56 | 56 | |
57 | 57 | Canonicalize a configuration name. |
58 | 58 | |
59 | Operation modes: | |
59 | Options: | |
60 | 60 | -h, --help print this help, then exit |
61 | 61 | -t, --time-stamp print date of last modification, then exit |
62 | 62 | -v, --version print version number, then exit |
66 | 66 | version="\ |
67 | 67 | GNU config.sub ($timestamp) |
68 | 68 | |
69 | Copyright 1992-2016 Free Software Foundation, Inc. | |
69 | Copyright 1992-2018 Free Software Foundation, Inc. | |
70 | 70 | |
71 | 71 | This is free software; see the source for copying conditions. There is NO |
72 | 72 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
93 | 93 | |
94 | 94 | *local*) |
95 | 95 | # First pass through any local machine types. |
96 | echo $1 | |
96 | echo "$1" | |
97 | 97 | exit ;; |
98 | 98 | |
99 | 99 | * ) |
111 | 111 | |
112 | 112 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). |
113 | 113 | # Here we must recognize all the valid KERNEL-OS combinations. |
114 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` | |
114 | maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` | |
115 | 115 | case $maybe_os in |
116 | 116 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ |
117 | 117 | linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ |
119 | 119 | kopensolaris*-gnu* | cloudabi*-eabi* | \ |
120 | 120 | storm-chaos* | os2-emx* | rtmk-nova*) |
121 | 121 | os=-$maybe_os |
122 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` | |
122 | basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` | |
123 | 123 | ;; |
124 | 124 | android-linux) |
125 | 125 | os=-linux-android |
126 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown | |
126 | basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown | |
127 | 127 | ;; |
128 | 128 | *) |
129 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` | |
130 | if [ $basic_machine != $1 ] | |
131 | then os=`echo $1 | sed 's/.*-/-/'` | |
129 | basic_machine=`echo "$1" | sed 's/-[^-]*$//'` | |
130 | if [ "$basic_machine" != "$1" ] | |
131 | then os=`echo "$1" | sed 's/.*-/-/'` | |
132 | 132 | else os=; fi |
133 | 133 | ;; |
134 | 134 | esac |
177 | 177 | ;; |
178 | 178 | -sco6) |
179 | 179 | os=-sco5v6 |
180 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
180 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
181 | 181 | ;; |
182 | 182 | -sco5) |
183 | 183 | os=-sco3.2v5 |
184 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
184 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
185 | 185 | ;; |
186 | 186 | -sco4) |
187 | 187 | os=-sco3.2v4 |
188 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
188 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
189 | 189 | ;; |
190 | 190 | -sco3.2.[4-9]*) |
191 | 191 | os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` |
192 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
192 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
193 | 193 | ;; |
194 | 194 | -sco3.2v[4-9]*) |
195 | 195 | # Don't forget version if it is 3.2v4 or newer. |
196 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
196 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
197 | 197 | ;; |
198 | 198 | -sco5v6*) |
199 | 199 | # Don't forget version if it is 3.2v4 or newer. |
200 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
200 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
201 | 201 | ;; |
202 | 202 | -sco*) |
203 | 203 | os=-sco3.2v2 |
204 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
204 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
205 | 205 | ;; |
206 | 206 | -udk*) |
207 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
207 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
208 | 208 | ;; |
209 | 209 | -isc) |
210 | 210 | os=-isc2.2 |
211 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
211 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
212 | 212 | ;; |
213 | 213 | -clix*) |
214 | 214 | basic_machine=clipper-intergraph |
215 | 215 | ;; |
216 | 216 | -isc*) |
217 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
217 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` | |
218 | 218 | ;; |
219 | 219 | -lynx*178) |
220 | 220 | os=-lynxos178 |
226 | 226 | os=-lynxos |
227 | 227 | ;; |
228 | 228 | -ptx*) |
229 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` | |
230 | ;; | |
231 | -windowsnt*) | |
232 | os=`echo $os | sed -e 's/windowsnt/winnt/'` | |
229 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` | |
233 | 230 | ;; |
234 | 231 | -psos*) |
235 | 232 | os=-psos |
262 | 259 | | fido | fr30 | frv | ft32 \ |
263 | 260 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ |
264 | 261 | | hexagon \ |
265 | | i370 | i860 | i960 | ia64 \ | |
262 | | i370 | i860 | i960 | ia16 | ia64 \ | |
266 | 263 | | ip2k | iq2000 \ |
267 | 264 | | k1om \ |
268 | 265 | | le32 | le64 \ |
298 | 295 | | nios | nios2 | nios2eb | nios2el \ |
299 | 296 | | ns16k | ns32k \ |
300 | 297 | | open8 | or1k | or1knd | or32 \ |
301 | | pdp10 | pdp11 | pj | pjl \ | |
298 | | pdp10 | pj | pjl \ | |
302 | 299 | | powerpc | powerpc64 | powerpc64le | powerpcle \ |
303 | 300 | | pru \ |
304 | 301 | | pyramid \ |
314 | 311 | | ubicom32 \ |
315 | 312 | | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ |
316 | 313 | | visium \ |
317 | | we32k \ | |
314 | | wasm32 \ | |
318 | 315 | | x86 | xc16x | xstormy16 | xtensa \ |
319 | 316 | | z8k | z80) |
320 | 317 | basic_machine=$basic_machine-unknown |
335 | 332 | basic_machine=$basic_machine-unknown |
336 | 333 | os=-none |
337 | 334 | ;; |
338 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) | |
335 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) | |
339 | 336 | ;; |
340 | 337 | ms1) |
341 | 338 | basic_machine=mt-unknown |
364 | 361 | ;; |
365 | 362 | # Object if more than one company name word. |
366 | 363 | *-*-*) |
367 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 | |
364 | echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 | |
368 | 365 | exit 1 |
369 | 366 | ;; |
370 | 367 | # Recognize the basic CPU types with company name. |
387 | 384 | | h8300-* | h8500-* \ |
388 | 385 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ |
389 | 386 | | hexagon-* \ |
390 | | i*86-* | i860-* | i960-* | ia64-* \ | |
387 | | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | |
391 | 388 | | ip2k-* | iq2000-* \ |
392 | 389 | | k1om-* \ |
393 | 390 | | le32-* | le64-* \ |
445 | 442 | | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ |
446 | 443 | | vax-* \ |
447 | 444 | | visium-* \ |
445 | | wasm32-* \ | |
448 | 446 | | we32k-* \ |
449 | 447 | | x86-* | x86_64-* | xc16x-* | xps100-* \ |
450 | 448 | | xstormy16-* | xtensa*-* \ |
458 | 456 | # Recognize the various machine names and aliases which stand |
459 | 457 | # for a CPU type and a company and sometimes even an OS. |
460 | 458 | 386bsd) |
461 | basic_machine=i386-unknown | |
459 | basic_machine=i386-pc | |
462 | 460 | os=-bsd |
463 | 461 | ;; |
464 | 462 | 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) |
492 | 490 | basic_machine=x86_64-pc |
493 | 491 | ;; |
494 | 492 | amd64-*) |
495 | basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` | |
493 | basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
496 | 494 | ;; |
497 | 495 | amdahl) |
498 | 496 | basic_machine=580-amdahl |
537 | 535 | os=-linux |
538 | 536 | ;; |
539 | 537 | blackfin-*) |
540 | basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` | |
538 | basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
541 | 539 | os=-linux |
542 | 540 | ;; |
543 | 541 | bluegene*) |
545 | 543 | os=-cnk |
546 | 544 | ;; |
547 | 545 | c54x-*) |
548 | basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` | |
546 | basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
549 | 547 | ;; |
550 | 548 | c55x-*) |
551 | basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` | |
549 | basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
552 | 550 | ;; |
553 | 551 | c6x-*) |
554 | basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` | |
552 | basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
555 | 553 | ;; |
556 | 554 | c90) |
557 | 555 | basic_machine=c90-cray |
640 | 638 | basic_machine=rs6000-bull |
641 | 639 | os=-bosx |
642 | 640 | ;; |
643 | dpx2* | dpx2*-bull) | |
641 | dpx2*) | |
644 | 642 | basic_machine=m68k-bull |
645 | 643 | os=-sysv3 |
646 | 644 | ;; |
649 | 647 | os=$os"spe" |
650 | 648 | ;; |
651 | 649 | e500v[12]-*) |
652 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
650 | basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
653 | 651 | os=$os"spe" |
654 | 652 | ;; |
655 | 653 | ebmon29k) |
741 | 739 | hp9k8[0-9][0-9] | hp8[0-9][0-9]) |
742 | 740 | basic_machine=hppa1.0-hp |
743 | 741 | ;; |
744 | hppa-next) | |
745 | os=-nextstep3 | |
746 | ;; | |
747 | 742 | hppaosf) |
748 | 743 | basic_machine=hppa1.1-hp |
749 | 744 | os=-osf |
756 | 751 | basic_machine=i370-ibm |
757 | 752 | ;; |
758 | 753 | i*86v32) |
759 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
754 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` | |
760 | 755 | os=-sysv32 |
761 | 756 | ;; |
762 | 757 | i*86v4*) |
763 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
758 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` | |
764 | 759 | os=-sysv4 |
765 | 760 | ;; |
766 | 761 | i*86v) |
767 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
762 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` | |
768 | 763 | os=-sysv |
769 | 764 | ;; |
770 | 765 | i*86sol2) |
771 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
766 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` | |
772 | 767 | os=-solaris2 |
773 | 768 | ;; |
774 | 769 | i386mach) |
775 | 770 | basic_machine=i386-mach |
776 | 771 | os=-mach |
777 | 772 | ;; |
778 | i386-vsta | vsta) | |
773 | vsta) | |
779 | 774 | basic_machine=i386-unknown |
780 | 775 | os=-vsta |
781 | 776 | ;; |
794 | 789 | os=-sysv |
795 | 790 | ;; |
796 | 791 | leon-*|leon[3-9]-*) |
797 | basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` | |
792 | basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` | |
798 | 793 | ;; |
799 | 794 | m68knommu) |
800 | 795 | basic_machine=m68k-unknown |
801 | 796 | os=-linux |
802 | 797 | ;; |
803 | 798 | m68knommu-*) |
804 | basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` | |
799 | basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
805 | 800 | os=-linux |
806 | ;; | |
807 | m88k-omron*) | |
808 | basic_machine=m88k-omron | |
809 | 801 | ;; |
810 | 802 | magnum | m3230) |
811 | 803 | basic_machine=mips-mips |
838 | 830 | os=-mint |
839 | 831 | ;; |
840 | 832 | mips3*-*) |
841 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` | |
833 | basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` | |
842 | 834 | ;; |
843 | 835 | mips3*) |
844 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown | |
836 | basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown | |
845 | 837 | ;; |
846 | 838 | monitor) |
847 | 839 | basic_machine=m68k-rom68k |
860 | 852 | os=-msdos |
861 | 853 | ;; |
862 | 854 | ms1-*) |
863 | basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` | |
855 | basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` | |
864 | 856 | ;; |
865 | 857 | msys) |
866 | 858 | basic_machine=i686-pc |
902 | 894 | basic_machine=v70-nec |
903 | 895 | os=-sysv |
904 | 896 | ;; |
905 | next | m*-next ) | |
897 | next | m*-next) | |
906 | 898 | basic_machine=m68k-next |
907 | 899 | case $os in |
908 | 900 | -nextstep* ) |
947 | 939 | nsr-tandem) |
948 | 940 | basic_machine=nsr-tandem |
949 | 941 | ;; |
942 | nsv-tandem) | |
943 | basic_machine=nsv-tandem | |
944 | ;; | |
945 | nsx-tandem) | |
946 | basic_machine=nsx-tandem | |
947 | ;; | |
950 | 948 | op50n-* | op60c-*) |
951 | 949 | basic_machine=hppa1.1-oki |
952 | 950 | os=-proelf |
979 | 977 | os=-linux |
980 | 978 | ;; |
981 | 979 | parisc-*) |
982 | basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` | |
980 | basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
983 | 981 | os=-linux |
984 | 982 | ;; |
985 | 983 | pbd) |
995 | 993 | basic_machine=i386-pc |
996 | 994 | ;; |
997 | 995 | pc98-*) |
998 | basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` | |
996 | basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
999 | 997 | ;; |
1000 | 998 | pentium | p5 | k5 | k6 | nexgen | viac3) |
1001 | 999 | basic_machine=i586-pc |
1010 | 1008 | basic_machine=i786-pc |
1011 | 1009 | ;; |
1012 | 1010 | pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) |
1013 | basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1011 | basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1014 | 1012 | ;; |
1015 | 1013 | pentiumpro-* | p6-* | 6x86-* | athlon-*) |
1016 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1014 | basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1017 | 1015 | ;; |
1018 | 1016 | pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) |
1019 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1017 | basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1020 | 1018 | ;; |
1021 | 1019 | pentium4-*) |
1022 | basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1020 | basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1023 | 1021 | ;; |
1024 | 1022 | pn) |
1025 | 1023 | basic_machine=pn-gould |
1029 | 1027 | ppc | ppcbe) basic_machine=powerpc-unknown |
1030 | 1028 | ;; |
1031 | 1029 | ppc-* | ppcbe-*) |
1032 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1030 | basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1033 | 1031 | ;; |
1034 | 1032 | ppcle | powerpclittle) |
1035 | 1033 | basic_machine=powerpcle-unknown |
1036 | 1034 | ;; |
1037 | 1035 | ppcle-* | powerpclittle-*) |
1038 | basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1036 | basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1039 | 1037 | ;; |
1040 | 1038 | ppc64) basic_machine=powerpc64-unknown |
1041 | 1039 | ;; |
1042 | ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1040 | ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1043 | 1041 | ;; |
1044 | 1042 | ppc64le | powerpc64little) |
1045 | 1043 | basic_machine=powerpc64le-unknown |
1046 | 1044 | ;; |
1047 | 1045 | ppc64le-* | powerpc64little-*) |
1048 | basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1046 | basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1049 | 1047 | ;; |
1050 | 1048 | ps2) |
1051 | 1049 | basic_machine=i386-ibm |
1099 | 1097 | sequent) |
1100 | 1098 | basic_machine=i386-sequent |
1101 | 1099 | ;; |
1102 | sh) | |
1103 | basic_machine=sh-hitachi | |
1104 | os=-hms | |
1105 | ;; | |
1106 | 1100 | sh5el) |
1107 | 1101 | basic_machine=sh5le-unknown |
1108 | 1102 | ;; |
1109 | sh64) | |
1110 | basic_machine=sh64-unknown | |
1111 | ;; | |
1112 | sparclite-wrs | simso-wrs) | |
1103 | simso-wrs) | |
1113 | 1104 | basic_machine=sparclite-wrs |
1114 | 1105 | os=-vxworks |
1115 | 1106 | ;; |
1128 | 1119 | os=-sysv4 |
1129 | 1120 | ;; |
1130 | 1121 | strongarm-* | thumb-*) |
1131 | basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1122 | basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` | |
1132 | 1123 | ;; |
1133 | 1124 | sun2) |
1134 | 1125 | basic_machine=m68000-sun |
1250 | 1241 | basic_machine=hppa1.1-winbond |
1251 | 1242 | os=-proelf |
1252 | 1243 | ;; |
1244 | x64) | |
1245 | basic_machine=x86_64-pc | |
1246 | ;; | |
1253 | 1247 | xbox) |
1254 | 1248 | basic_machine=i686-pc |
1255 | 1249 | os=-mingw32 |
1258 | 1252 | basic_machine=xps100-honeywell |
1259 | 1253 | ;; |
1260 | 1254 | xscale-* | xscalee[bl]-*) |
1261 | basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` | |
1255 | basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` | |
1262 | 1256 | ;; |
1263 | 1257 | ymp) |
1264 | 1258 | basic_machine=ymp-cray |
1265 | 1259 | os=-unicos |
1266 | ;; | |
1267 | z8k-*-coff) | |
1268 | basic_machine=z8k-unknown | |
1269 | os=-sim | |
1270 | ;; | |
1271 | z80-*-coff) | |
1272 | basic_machine=z80-unknown | |
1273 | os=-sim | |
1274 | 1260 | ;; |
1275 | 1261 | none) |
1276 | 1262 | basic_machine=none-none |
1300 | 1286 | vax) |
1301 | 1287 | basic_machine=vax-dec |
1302 | 1288 | ;; |
1303 | pdp10) | |
1304 | # there are many clones, so DEC is not a safe bet | |
1305 | basic_machine=pdp10-unknown | |
1306 | ;; | |
1307 | 1289 | pdp11) |
1308 | 1290 | basic_machine=pdp11-dec |
1309 | 1291 | ;; |
1313 | 1295 | sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) |
1314 | 1296 | basic_machine=sh-unknown |
1315 | 1297 | ;; |
1316 | sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) | |
1317 | basic_machine=sparc-sun | |
1318 | ;; | |
1319 | 1298 | cydra) |
1320 | 1299 | basic_machine=cydra-cydrome |
1321 | 1300 | ;; |
1335 | 1314 | # Make sure to match an already-canonicalized machine name. |
1336 | 1315 | ;; |
1337 | 1316 | *) |
1338 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 | |
1317 | echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 | |
1339 | 1318 | exit 1 |
1340 | 1319 | ;; |
1341 | 1320 | esac |
1343 | 1322 | # Here we canonicalize certain aliases for manufacturers. |
1344 | 1323 | case $basic_machine in |
1345 | 1324 | *-digital*) |
1346 | basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` | |
1325 | basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` | |
1347 | 1326 | ;; |
1348 | 1327 | *-commodore*) |
1349 | basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` | |
1328 | basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` | |
1350 | 1329 | ;; |
1351 | 1330 | *) |
1352 | 1331 | ;; |
1357 | 1336 | if [ x"$os" != x"" ] |
1358 | 1337 | then |
1359 | 1338 | case $os in |
1360 | # First match some system type aliases | |
1361 | # that might get confused with valid system types. | |
1339 | # First match some system type aliases that might get confused | |
1340 | # with valid system types. | |
1362 | 1341 | # -solaris* is a basic system type, with this one exception. |
1363 | 1342 | -auroraux) |
1364 | 1343 | os=-auroraux |
1369 | 1348 | -solaris) |
1370 | 1349 | os=-solaris2 |
1371 | 1350 | ;; |
1372 | -svr4*) | |
1373 | os=-sysv4 | |
1374 | ;; | |
1375 | 1351 | -unixware*) |
1376 | 1352 | os=-sysv4.2uw |
1377 | 1353 | ;; |
1378 | 1354 | -gnu/linux*) |
1379 | 1355 | os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` |
1380 | 1356 | ;; |
1381 | # First accept the basic system types. | |
1357 | # es1800 is here to avoid being matched by es* (a different OS) | |
1358 | -es1800*) | |
1359 | os=-ose | |
1360 | ;; | |
1361 | # Now accept the basic system types. | |
1382 | 1362 | # The portable systems comes first. |
1383 | # Each alternative MUST END IN A *, to match a version number. | |
1363 | # Each alternative MUST end in a * to match a version number. | |
1384 | 1364 | # -sysv* is not here because it comes later, after sysvr4. |
1385 | 1365 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ |
1386 | 1366 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ |
1390 | 1370 | | -aos* | -aros* | -cloudabi* | -sortix* \ |
1391 | 1371 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ |
1392 | 1372 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ |
1393 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | |
1373 | | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | |
1394 | 1374 | | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ |
1395 | 1375 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ |
1396 | 1376 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ |
1397 | 1377 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ |
1398 | 1378 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
1399 | | -chorusos* | -chorusrdb* | -cegcc* \ | |
1379 | | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | |
1400 | 1380 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ |
1401 | 1381 | | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ |
1402 | 1382 | | -linux-newlib* | -linux-musl* | -linux-uclibc* \ |
1403 | 1383 | | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ |
1404 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | |
1384 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | |
1405 | 1385 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
1406 | 1386 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ |
1407 | 1387 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
1408 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | |
1388 | | -morphos* | -superux* | -rtmk* | -windiss* \ | |
1409 | 1389 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
1410 | 1390 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ |
1411 | | -onefs* | -tirtos* | -phoenix* | -fuchsia*) | |
1391 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | |
1392 | | -midnightbsd*) | |
1412 | 1393 | # Remember, each alternative MUST END IN *, to match a version number. |
1413 | 1394 | ;; |
1414 | 1395 | -qnx*) |
1425 | 1406 | -nto*) |
1426 | 1407 | os=`echo $os | sed -e 's|nto|nto-qnx|'` |
1427 | 1408 | ;; |
1428 | -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | |
1429 | | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | |
1409 | -sim | -xray | -os68k* | -v88r* \ | |
1410 | | -windows* | -osx | -abug | -netware* | -os9* \ | |
1430 | 1411 | | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) |
1431 | 1412 | ;; |
1432 | 1413 | -mac*) |
1433 | os=`echo $os | sed -e 's|mac|macos|'` | |
1414 | os=`echo "$os" | sed -e 's|mac|macos|'` | |
1434 | 1415 | ;; |
1435 | 1416 | -linux-dietlibc) |
1436 | 1417 | os=-linux-dietlibc |
1439 | 1420 | os=`echo $os | sed -e 's|linux|linux-gnu|'` |
1440 | 1421 | ;; |
1441 | 1422 | -sunos5*) |
1442 | os=`echo $os | sed -e 's|sunos5|solaris2|'` | |
1423 | os=`echo "$os" | sed -e 's|sunos5|solaris2|'` | |
1443 | 1424 | ;; |
1444 | 1425 | -sunos6*) |
1445 | os=`echo $os | sed -e 's|sunos6|solaris3|'` | |
1426 | os=`echo "$os" | sed -e 's|sunos6|solaris3|'` | |
1446 | 1427 | ;; |
1447 | 1428 | -opened*) |
1448 | 1429 | os=-openedition |
1453 | 1434 | -wince*) |
1454 | 1435 | os=-wince |
1455 | 1436 | ;; |
1456 | -osfrose*) | |
1457 | os=-osfrose | |
1458 | ;; | |
1459 | -osf*) | |
1460 | os=-osf | |
1461 | ;; | |
1462 | 1437 | -utek*) |
1463 | 1438 | os=-bsd |
1464 | 1439 | ;; |
1483 | 1458 | -nova*) |
1484 | 1459 | os=-rtmk-nova |
1485 | 1460 | ;; |
1486 | -ns2 ) | |
1461 | -ns2) | |
1487 | 1462 | os=-nextstep2 |
1488 | 1463 | ;; |
1489 | 1464 | -nsk*) |
1505 | 1480 | -oss*) |
1506 | 1481 | os=-sysv3 |
1507 | 1482 | ;; |
1508 | -svr4) | |
1483 | -svr4*) | |
1509 | 1484 | os=-sysv4 |
1510 | 1485 | ;; |
1511 | 1486 | -svr3) |
1520 | 1495 | -ose*) |
1521 | 1496 | os=-ose |
1522 | 1497 | ;; |
1523 | -es1800*) | |
1524 | os=-ose | |
1525 | ;; | |
1526 | -xenix) | |
1527 | os=-xenix | |
1528 | ;; | |
1529 | 1498 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) |
1530 | 1499 | os=-mint |
1531 | 1500 | ;; |
1532 | -aros*) | |
1533 | os=-aros | |
1534 | ;; | |
1535 | 1501 | -zvmoe) |
1536 | 1502 | os=-zvmoe |
1537 | 1503 | ;; |
1538 | 1504 | -dicos*) |
1539 | 1505 | os=-dicos |
1506 | ;; | |
1507 | -pikeos*) | |
1508 | # Until real need of OS specific support for | |
1509 | # particular features comes up, bare metal | |
1510 | # configurations are quite functional. | |
1511 | case $basic_machine in | |
1512 | arm*) | |
1513 | os=-eabi | |
1514 | ;; | |
1515 | *) | |
1516 | os=-elf | |
1517 | ;; | |
1518 | esac | |
1540 | 1519 | ;; |
1541 | 1520 | -nacl*) |
1542 | 1521 | ;; |
1547 | 1526 | *) |
1548 | 1527 | # Get rid of the `-' at the beginning of $os. |
1549 | 1528 | os=`echo $os | sed 's/[^-]*-//'` |
1550 | echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 | |
1529 | echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 | |
1551 | 1530 | exit 1 |
1552 | 1531 | ;; |
1553 | 1532 | esac |
1637 | 1616 | sparc-* | *-sun) |
1638 | 1617 | os=-sunos4.1.1 |
1639 | 1618 | ;; |
1619 | pru-*) | |
1620 | os=-elf | |
1621 | ;; | |
1640 | 1622 | *-be) |
1641 | 1623 | os=-beos |
1642 | 1624 | ;; |
1643 | *-haiku) | |
1644 | os=-haiku | |
1645 | ;; | |
1646 | 1625 | *-ibm) |
1647 | 1626 | os=-aix |
1648 | 1627 | ;; |
1682 | 1661 | m88k-omron*) |
1683 | 1662 | os=-luna |
1684 | 1663 | ;; |
1685 | *-next ) | |
1664 | *-next) | |
1686 | 1665 | os=-nextstep |
1687 | 1666 | ;; |
1688 | 1667 | *-sequent) |
1696 | 1675 | ;; |
1697 | 1676 | i370-*) |
1698 | 1677 | os=-mvs |
1699 | ;; | |
1700 | *-next) | |
1701 | os=-nextstep3 | |
1702 | 1678 | ;; |
1703 | 1679 | *-gould) |
1704 | 1680 | os=-sysv |
1809 | 1785 | vendor=stratus |
1810 | 1786 | ;; |
1811 | 1787 | esac |
1812 | basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` | |
1788 | basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` | |
1813 | 1789 | ;; |
1814 | 1790 | esac |
1815 | 1791 | |
1816 | echo $basic_machine$os | |
1792 | echo "$basic_machine$os" | |
1817 | 1793 | exit |
1818 | 1794 | |
1819 | 1795 | # Local variables: |
1820 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
1796 | # eval: (add-hook 'write-file-functions 'time-stamp) | |
1821 | 1797 | # time-stamp-start: "timestamp='" |
1822 | 1798 | # time-stamp-format: "%:y-%02m-%02d" |
1823 | 1799 | # time-stamp-end: "'" |
0 | 0 | #! /bin/sh |
1 | 1 | # depcomp - compile a program generating dependencies as side-effects |
2 | 2 | |
3 | scriptversion=2013-05-30.07; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. | |
3 | scriptversion=2018-03-07.03; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
6 | 6 | |
7 | 7 | # This program is free software; you can redistribute it and/or modify |
8 | 8 | # it under the terms of the GNU General Public License as published by |
15 | 15 | # GNU General Public License for more details. |
16 | 16 | |
17 | 17 | # You should have received a copy of the GNU General Public License |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
19 | 19 | |
20 | 20 | # As a special exception to the GNU General Public License, if you |
21 | 21 | # distribute this file as part of a program that contains a |
782 | 782 | # Local Variables: |
783 | 783 | # mode: shell-script |
784 | 784 | # sh-indentation: 2 |
785 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
785 | # eval: (add-hook 'before-save-hook 'time-stamp) | |
786 | 786 | # time-stamp-start: "scriptversion=" |
787 | 787 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
788 | # time-stamp-time-zone: "UTC" | |
788 | # time-stamp-time-zone: "UTC0" | |
789 | 789 | # time-stamp-end: "; # UTC" |
790 | 790 | # End: |
0 | 0 | #!/bin/sh |
1 | 1 | # install - install a program, script, or datafile |
2 | 2 | |
3 | scriptversion=2014-09-12.12; # UTC | |
3 | scriptversion=2018-03-11.20; # UTC | |
4 | 4 | |
5 | 5 | # This originates from X11R5 (mit/util/scripts/install.sh), which was |
6 | 6 | # later released in X11R6 (xc/config/util/install.sh) with the |
270 | 270 | fi |
271 | 271 | dst=$dst_arg |
272 | 272 | |
273 | # If destination is a directory, append the input filename; won't work | |
274 | # if double slashes aren't ignored. | |
273 | # If destination is a directory, append the input filename. | |
275 | 274 | if test -d "$dst"; then |
276 | 275 | if test "$is_target_a_directory" = never; then |
277 | 276 | echo "$0: $dst_arg: Is a directory" >&2 |
278 | 277 | exit 1 |
279 | 278 | fi |
280 | 279 | dstdir=$dst |
281 | dst=$dstdir/`basename "$src"` | |
280 | dstbase=`basename "$src"` | |
281 | case $dst in | |
282 | */) dst=$dst$dstbase;; | |
283 | *) dst=$dst/$dstbase;; | |
284 | esac | |
282 | 285 | dstdir_status=0 |
283 | 286 | else |
284 | 287 | dstdir=`dirname "$dst"` |
286 | 289 | dstdir_status=$? |
287 | 290 | fi |
288 | 291 | fi |
292 | ||
293 | case $dstdir in | |
294 | */) dstdirslash=$dstdir;; | |
295 | *) dstdirslash=$dstdir/;; | |
296 | esac | |
289 | 297 | |
290 | 298 | obsolete_mkdir_used=false |
291 | 299 | |
323 | 331 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. |
324 | 332 | ;; |
325 | 333 | *) |
326 | # $RANDOM is not portable (e.g. dash); use it when possible to | |
327 | # lower collision chance | |
334 | # Note that $RANDOM variable is not portable (e.g. dash); Use it | |
335 | # here however when possible just to lower collision chance. | |
328 | 336 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ |
337 | ||
329 | 338 | trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 |
330 | 339 | |
331 | # As "mkdir -p" follows symlinks and we work in /tmp possibly; so | |
332 | # create the $tmpdir first (and fail if unsuccessful) to make sure | |
333 | # that nobody tries to guess the $tmpdir name. | |
340 | # Because "mkdir -p" follows existing symlinks and we likely work | |
341 | # directly in world-writeable /tmp, make sure that the '$tmpdir' | |
342 | # directory is successfully created first before we actually test | |
343 | # 'mkdir -p' feature. | |
334 | 344 | if (umask $mkdir_umask && |
335 | 345 | $mkdirprog $mkdir_mode "$tmpdir" && |
336 | 346 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 |
433 | 443 | else |
434 | 444 | |
435 | 445 | # Make a couple of temp file names in the proper directory. |
436 | dsttmp=$dstdir/_inst.$$_ | |
437 | rmtmp=$dstdir/_rm.$$_ | |
446 | dsttmp=${dstdirslash}_inst.$$_ | |
447 | rmtmp=${dstdirslash}_rm.$$_ | |
438 | 448 | |
439 | 449 | # Trap to clean up those temp files at exit. |
440 | 450 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 |
499 | 509 | done |
500 | 510 | |
501 | 511 | # Local variables: |
502 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
512 | # eval: (add-hook 'before-save-hook 'time-stamp) | |
503 | 513 | # time-stamp-start: "scriptversion=" |
504 | 514 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
505 | # time-stamp-time-zone: "UTC" | |
515 | # time-stamp-time-zone: "UTC0" | |
506 | 516 | # time-stamp-end: "; # UTC" |
507 | 517 | # End: |
30 | 30 | |
31 | 31 | PROGRAM=libtool |
32 | 32 | PACKAGE=libtool |
33 | VERSION="2.4.6 Debian-2.4.6-2" | |
33 | VERSION="2.4.6 Debian-2.4.6-9" | |
34 | 34 | package_revision=2.4.6 |
35 | 35 | |
36 | 36 | |
1369 | 1369 | #! /bin/sh |
1370 | 1370 | |
1371 | 1371 | # Set a version string for this script. |
1372 | scriptversion=2014-01-07.03; # UTC | |
1372 | scriptversion=2015-10-07.11; # UTC | |
1373 | 1373 | |
1374 | 1374 | # A portable, pluggable option parser for Bourne shell. |
1375 | 1375 | # Written by Gary V. Vaughan, 2010 |
1529 | 1529 | { |
1530 | 1530 | $debug_cmd |
1531 | 1531 | |
1532 | _G_rc_run_hooks=false | |
1533 | ||
1532 | 1534 | case " $hookable_fns " in |
1533 | 1535 | *" $1 "*) ;; |
1534 | 1536 | *) func_fatal_error "'$1' does not support hook funcions.n" ;; |
1537 | 1539 | eval _G_hook_fns=\$$1_hooks; shift |
1538 | 1540 | |
1539 | 1541 | for _G_hook in $_G_hook_fns; do |
1540 | eval $_G_hook '"$@"' | |
1541 | ||
1542 | # store returned options list back into positional | |
1543 | # parameters for next 'cmd' execution. | |
1544 | eval _G_hook_result=\$${_G_hook}_result | |
1545 | eval set dummy "$_G_hook_result"; shift | |
1542 | if eval $_G_hook '"$@"'; then | |
1543 | # store returned options list back into positional | |
1544 | # parameters for next 'cmd' execution. | |
1545 | eval _G_hook_result=\$${_G_hook}_result | |
1546 | eval set dummy "$_G_hook_result"; shift | |
1547 | _G_rc_run_hooks=: | |
1548 | fi | |
1546 | 1549 | done |
1547 | 1550 | |
1548 | func_quote_for_eval ${1+"$@"} | |
1549 | func_run_hooks_result=$func_quote_for_eval_result | |
1551 | $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result | |
1550 | 1552 | } |
1551 | 1553 | |
1552 | 1554 | |
1556 | 1558 | ## --------------- ## |
1557 | 1559 | |
1558 | 1560 | # In order to add your own option parsing hooks, you must accept the |
1559 | # full positional parameter list in your hook function, remove any | |
1560 | # options that you action, and then pass back the remaining unprocessed | |
1561 | # full positional parameter list in your hook function, you may remove/edit | |
1562 | # any options that you action, and then pass back the remaining unprocessed | |
1561 | 1563 | # options in '<hooked_function_name>_result', escaped suitably for |
1562 | # 'eval'. Like this: | |
1564 | # 'eval'. In this case you also must return $EXIT_SUCCESS to let the | |
1565 | # hook's caller know that it should pay attention to | |
1566 | # '<hooked_function_name>_result'. Returning $EXIT_FAILURE signalizes that | |
1567 | # arguments are left untouched by the hook and therefore caller will ignore the | |
1568 | # result variable. | |
1569 | # | |
1570 | # Like this: | |
1563 | 1571 | # |
1564 | 1572 | # my_options_prep () |
1565 | 1573 | # { |
1569 | 1577 | # usage_message=$usage_message' |
1570 | 1578 | # -s, --silent don'\''t print informational messages |
1571 | 1579 | # ' |
1572 | # | |
1573 | # func_quote_for_eval ${1+"$@"} | |
1574 | # my_options_prep_result=$func_quote_for_eval_result | |
1580 | # # No change in '$@' (ignored completely by this hook). There is | |
1581 | # # no need to do the equivalent (but slower) action: | |
1582 | # # func_quote_for_eval ${1+"$@"} | |
1583 | # # my_options_prep_result=$func_quote_for_eval_result | |
1584 | # false | |
1575 | 1585 | # } |
1576 | 1586 | # func_add_hook func_options_prep my_options_prep |
1577 | 1587 | # |
1580 | 1590 | # { |
1581 | 1591 | # $debug_cmd |
1582 | 1592 | # |
1593 | # args_changed=false | |
1594 | # | |
1583 | 1595 | # # Note that for efficiency, we parse as many options as we can |
1584 | 1596 | # # recognise in a loop before passing the remainder back to the |
1585 | 1597 | # # caller on the first unrecognised argument we encounter. |
1586 | 1598 | # while test $# -gt 0; do |
1587 | 1599 | # opt=$1; shift |
1588 | 1600 | # case $opt in |
1589 | # --silent|-s) opt_silent=: ;; | |
1601 | # --silent|-s) opt_silent=: | |
1602 | # args_changed=: | |
1603 | # ;; | |
1590 | 1604 | # # Separate non-argument short options: |
1591 | 1605 | # -s*) func_split_short_opt "$_G_opt" |
1592 | 1606 | # set dummy "$func_split_short_opt_name" \ |
1593 | 1607 | # "-$func_split_short_opt_arg" ${1+"$@"} |
1594 | 1608 | # shift |
1609 | # args_changed=: | |
1595 | 1610 | # ;; |
1596 | # *) set dummy "$_G_opt" "$*"; shift; break ;; | |
1611 | # *) # Make sure the first unrecognised option "$_G_opt" | |
1612 | # # is added back to "$@", we could need that later | |
1613 | # # if $args_changed is true. | |
1614 | # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
1597 | 1615 | # esac |
1598 | 1616 | # done |
1599 | 1617 | # |
1600 | # func_quote_for_eval ${1+"$@"} | |
1601 | # my_silent_option_result=$func_quote_for_eval_result | |
1618 | # if $args_changed; then | |
1619 | # func_quote_for_eval ${1+"$@"} | |
1620 | # my_silent_option_result=$func_quote_for_eval_result | |
1621 | # fi | |
1622 | # | |
1623 | # $args_changed | |
1602 | 1624 | # } |
1603 | 1625 | # func_add_hook func_parse_options my_silent_option |
1604 | 1626 | # |
1610 | 1632 | # $opt_silent && $opt_verbose && func_fatal_help "\ |
1611 | 1633 | # '--silent' and '--verbose' options are mutually exclusive." |
1612 | 1634 | # |
1613 | # func_quote_for_eval ${1+"$@"} | |
1614 | # my_option_validation_result=$func_quote_for_eval_result | |
1635 | # false | |
1615 | 1636 | # } |
1616 | 1637 | # func_add_hook func_validate_options my_option_validation |
1617 | 1638 | # |
1618 | # You'll alse need to manually amend $usage_message to reflect the extra | |
1639 | # You'll also need to manually amend $usage_message to reflect the extra | |
1619 | 1640 | # options you parse. It's preferable to append if you can, so that |
1620 | 1641 | # multiple option parsing hooks can be added safely. |
1642 | ||
1643 | ||
1644 | # func_options_finish [ARG]... | |
1645 | # ---------------------------- | |
1646 | # Finishing the option parse loop (call 'func_options' hooks ATM). | |
1647 | func_options_finish () | |
1648 | { | |
1649 | $debug_cmd | |
1650 | ||
1651 | _G_func_options_finish_exit=false | |
1652 | if func_run_hooks func_options ${1+"$@"}; then | |
1653 | func_options_finish_result=$func_run_hooks_result | |
1654 | _G_func_options_finish_exit=: | |
1655 | fi | |
1656 | ||
1657 | $_G_func_options_finish_exit | |
1658 | } | |
1621 | 1659 | |
1622 | 1660 | |
1623 | 1661 | # func_options [ARG]... |
1629 | 1667 | { |
1630 | 1668 | $debug_cmd |
1631 | 1669 | |
1632 | func_options_prep ${1+"$@"} | |
1633 | eval func_parse_options \ | |
1634 | ${func_options_prep_result+"$func_options_prep_result"} | |
1635 | eval func_validate_options \ | |
1636 | ${func_parse_options_result+"$func_parse_options_result"} | |
1637 | ||
1638 | eval func_run_hooks func_options \ | |
1639 | ${func_validate_options_result+"$func_validate_options_result"} | |
1640 | ||
1641 | # save modified positional parameters for caller | |
1642 | func_options_result=$func_run_hooks_result | |
1670 | _G_rc_options=false | |
1671 | ||
1672 | for my_func in options_prep parse_options validate_options options_finish | |
1673 | do | |
1674 | if eval func_$my_func '${1+"$@"}'; then | |
1675 | eval _G_res_var='$'"func_${my_func}_result" | |
1676 | eval set dummy "$_G_res_var" ; shift | |
1677 | _G_rc_options=: | |
1678 | fi | |
1679 | done | |
1680 | ||
1681 | # Save modified positional parameters for caller. As a top-level | |
1682 | # options-parser function we always need to set the 'func_options_result' | |
1683 | # variable (regardless the $_G_rc_options value). | |
1684 | if $_G_rc_options; then | |
1685 | func_options_result=$_G_res_var | |
1686 | else | |
1687 | func_quote_for_eval ${1+"$@"} | |
1688 | func_options_result=$func_quote_for_eval_result | |
1689 | fi | |
1690 | ||
1691 | $_G_rc_options | |
1643 | 1692 | } |
1644 | 1693 | |
1645 | 1694 | |
1648 | 1697 | # All initialisations required before starting the option parse loop. |
1649 | 1698 | # Note that when calling hook functions, we pass through the list of |
1650 | 1699 | # positional parameters. If a hook function modifies that list, and |
1651 | # needs to propogate that back to rest of this script, then the complete | |
1700 | # needs to propagate that back to rest of this script, then the complete | |
1652 | 1701 | # modified list must be put in 'func_run_hooks_result' before |
1653 | # returning. | |
1702 | # returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). | |
1654 | 1703 | func_hookable func_options_prep |
1655 | 1704 | func_options_prep () |
1656 | 1705 | { |
1660 | 1709 | opt_verbose=false |
1661 | 1710 | opt_warning_types= |
1662 | 1711 | |
1663 | func_run_hooks func_options_prep ${1+"$@"} | |
1664 | ||
1665 | # save modified positional parameters for caller | |
1666 | func_options_prep_result=$func_run_hooks_result | |
1712 | _G_rc_options_prep=false | |
1713 | if func_run_hooks func_options_prep ${1+"$@"}; then | |
1714 | _G_rc_options_prep=: | |
1715 | # save modified positional parameters for caller | |
1716 | func_options_prep_result=$func_run_hooks_result | |
1717 | fi | |
1718 | ||
1719 | $_G_rc_options_prep | |
1667 | 1720 | } |
1668 | 1721 | |
1669 | 1722 | |
1677 | 1730 | |
1678 | 1731 | func_parse_options_result= |
1679 | 1732 | |
1733 | _G_rc_parse_options=false | |
1680 | 1734 | # this just eases exit handling |
1681 | 1735 | while test $# -gt 0; do |
1682 | 1736 | # Defer to hook functions for initial option parsing, so they |
1683 | 1737 | # get priority in the event of reusing an option name. |
1684 | func_run_hooks func_parse_options ${1+"$@"} | |
1685 | ||
1686 | # Adjust func_parse_options positional parameters to match | |
1687 | eval set dummy "$func_run_hooks_result"; shift | |
1738 | if func_run_hooks func_parse_options ${1+"$@"}; then | |
1739 | eval set dummy "$func_run_hooks_result"; shift | |
1740 | _G_rc_parse_options=: | |
1741 | fi | |
1688 | 1742 | |
1689 | 1743 | # Break out of the loop if we already parsed every option. |
1690 | 1744 | test $# -gt 0 || break |
1691 | 1745 | |
1746 | _G_match_parse_options=: | |
1692 | 1747 | _G_opt=$1 |
1693 | 1748 | shift |
1694 | 1749 | case $_G_opt in |
1703 | 1758 | ;; |
1704 | 1759 | |
1705 | 1760 | --warnings|--warning|-W) |
1706 | test $# = 0 && func_missing_arg $_G_opt && break | |
1761 | if test $# = 0 && func_missing_arg $_G_opt; then | |
1762 | _G_rc_parse_options=: | |
1763 | break | |
1764 | fi | |
1707 | 1765 | case " $warning_categories $1" in |
1708 | 1766 | *" $1 "*) |
1709 | 1767 | # trailing space prevents matching last $1 above |
1756 | 1814 | shift |
1757 | 1815 | ;; |
1758 | 1816 | |
1759 | --) break ;; | |
1817 | --) _G_rc_parse_options=: ; break ;; | |
1760 | 1818 | -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; |
1761 | *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
1819 | *) set dummy "$_G_opt" ${1+"$@"}; shift | |
1820 | _G_match_parse_options=false | |
1821 | break | |
1822 | ;; | |
1762 | 1823 | esac |
1824 | ||
1825 | $_G_match_parse_options && _G_rc_parse_options=: | |
1763 | 1826 | done |
1764 | 1827 | |
1765 | # save modified positional parameters for caller | |
1766 | func_quote_for_eval ${1+"$@"} | |
1767 | func_parse_options_result=$func_quote_for_eval_result | |
1828 | ||
1829 | if $_G_rc_parse_options; then | |
1830 | # save modified positional parameters for caller | |
1831 | func_quote_for_eval ${1+"$@"} | |
1832 | func_parse_options_result=$func_quote_for_eval_result | |
1833 | fi | |
1834 | ||
1835 | $_G_rc_parse_options | |
1768 | 1836 | } |
1769 | 1837 | |
1770 | 1838 | |
1777 | 1845 | { |
1778 | 1846 | $debug_cmd |
1779 | 1847 | |
1848 | _G_rc_validate_options=false | |
1849 | ||
1780 | 1850 | # Display all warnings if -W was not given. |
1781 | 1851 | test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" |
1782 | 1852 | |
1783 | func_run_hooks func_validate_options ${1+"$@"} | |
1853 | if func_run_hooks func_validate_options ${1+"$@"}; then | |
1854 | # save modified positional parameters for caller | |
1855 | func_validate_options_result=$func_run_hooks_result | |
1856 | _G_rc_validate_options=: | |
1857 | fi | |
1784 | 1858 | |
1785 | 1859 | # Bail if the options were screwed! |
1786 | 1860 | $exit_cmd $EXIT_FAILURE |
1787 | 1861 | |
1788 | # save modified positional parameters for caller | |
1789 | func_validate_options_result=$func_run_hooks_result | |
1862 | $_G_rc_validate_options | |
1790 | 1863 | } |
1791 | 1864 | |
1792 | 1865 | |
2067 | 2140 | compiler: $LTCC |
2068 | 2141 | compiler flags: $LTCFLAGS |
2069 | 2142 | linker: $LD (gnu? $with_gnu_ld) |
2070 | version: $progname $scriptversion Debian-2.4.6-2 | |
2143 | version: $progname $scriptversion Debian-2.4.6-9 | |
2071 | 2144 | automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` |
2072 | 2145 | autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` |
2073 | 2146 | |
2269 | 2342 | nonopt= |
2270 | 2343 | preserve_args= |
2271 | 2344 | |
2345 | _G_rc_lt_options_prep=: | |
2346 | ||
2272 | 2347 | # Shorthand for --mode=foo, only valid as the first argument |
2273 | 2348 | case $1 in |
2274 | 2349 | clean|clea|cle|cl) |
2292 | 2367 | uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) |
2293 | 2368 | shift; set dummy --mode uninstall ${1+"$@"}; shift |
2294 | 2369 | ;; |
2370 | *) | |
2371 | _G_rc_lt_options_prep=false | |
2372 | ;; | |
2295 | 2373 | esac |
2296 | 2374 | |
2297 | # Pass back the list of options. | |
2298 | func_quote_for_eval ${1+"$@"} | |
2299 | libtool_options_prep_result=$func_quote_for_eval_result | |
2375 | if $_G_rc_lt_options_prep; then | |
2376 | # Pass back the list of options. | |
2377 | func_quote_for_eval ${1+"$@"} | |
2378 | libtool_options_prep_result=$func_quote_for_eval_result | |
2379 | fi | |
2380 | ||
2381 | $_G_rc_lt_options_prep | |
2300 | 2382 | } |
2301 | 2383 | func_add_hook func_options_prep libtool_options_prep |
2302 | 2384 | |
2308 | 2390 | { |
2309 | 2391 | $debug_cmd |
2310 | 2392 | |
2393 | _G_rc_lt_parse_options=false | |
2394 | ||
2311 | 2395 | # Perform our own loop to consume as many options as possible in |
2312 | 2396 | # each iteration. |
2313 | 2397 | while test $# -gt 0; do |
2398 | _G_match_lt_parse_options=: | |
2314 | 2399 | _G_opt=$1 |
2315 | 2400 | shift |
2316 | 2401 | case $_G_opt in |
2385 | 2470 | func_append preserve_args " $_G_opt" |
2386 | 2471 | ;; |
2387 | 2472 | |
2388 | # An option not handled by this hook function: | |
2389 | *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
2473 | # An option not handled by this hook function: | |
2474 | *) set dummy "$_G_opt" ${1+"$@"} ; shift | |
2475 | _G_match_lt_parse_options=false | |
2476 | break | |
2477 | ;; | |
2390 | 2478 | esac |
2479 | $_G_match_lt_parse_options && _G_rc_lt_parse_options=: | |
2391 | 2480 | done |
2392 | 2481 | |
2393 | ||
2394 | # save modified positional parameters for caller | |
2395 | func_quote_for_eval ${1+"$@"} | |
2396 | libtool_parse_options_result=$func_quote_for_eval_result | |
2482 | if $_G_rc_lt_parse_options; then | |
2483 | # save modified positional parameters for caller | |
2484 | func_quote_for_eval ${1+"$@"} | |
2485 | libtool_parse_options_result=$func_quote_for_eval_result | |
2486 | fi | |
2487 | ||
2488 | $_G_rc_lt_parse_options | |
2397 | 2489 | } |
2398 | 2490 | func_add_hook func_parse_options libtool_parse_options |
2399 | 2491 | |
7274 | 7366 | # -specs=* GCC specs files |
7275 | 7367 | # -stdlib=* select c++ std lib with clang |
7276 | 7368 | # -fsanitize=* Clang/GCC memory and address sanitizer |
7369 | # -fuse-ld=* Linker select flags for GCC | |
7277 | 7370 | -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ |
7278 | 7371 | -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ |
7279 | 7372 | -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ |
7280 | -specs=*|-fsanitize=*) | |
7373 | -specs=*|-fsanitize=*|-fuse-ld=*) | |
7281 | 7374 | func_quote_for_eval "$arg" |
7282 | 7375 | arg=$func_quote_for_eval_result |
7283 | 7376 | func_append compile_command " $arg" |
0 | 0 | #! /bin/sh |
1 | 1 | # Common wrapper for a few potentially missing GNU programs. |
2 | 2 | |
3 | scriptversion=2013-10-28.13; # UTC | |
4 | ||
5 | # Copyright (C) 1996-2014 Free Software Foundation, Inc. | |
3 | scriptversion=2018-03-07.03; # UTC | |
4 | ||
5 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
6 | 6 | # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. |
7 | 7 | |
8 | 8 | # This program is free software; you can redistribute it and/or modify |
16 | 16 | # GNU General Public License for more details. |
17 | 17 | |
18 | 18 | # You should have received a copy of the GNU General Public License |
19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
20 | 20 | |
21 | 21 | # As a special exception to the GNU General Public License, if you |
22 | 22 | # distribute this file as part of a program that contains a |
100 | 100 | exit $st |
101 | 101 | fi |
102 | 102 | |
103 | perl_URL=http://www.perl.org/ | |
104 | flex_URL=http://flex.sourceforge.net/ | |
105 | gnu_software_URL=http://www.gnu.org/software | |
103 | perl_URL=https://www.perl.org/ | |
104 | flex_URL=https://github.com/westes/flex | |
105 | gnu_software_URL=https://www.gnu.org/software | |
106 | 106 | |
107 | 107 | program_details () |
108 | 108 | { |
206 | 206 | exit $st |
207 | 207 | |
208 | 208 | # Local variables: |
209 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
209 | # eval: (add-hook 'before-save-hook 'time-stamp) | |
210 | 210 | # time-stamp-start: "scriptversion=" |
211 | 211 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
212 | # time-stamp-time-zone: "UTC" | |
212 | # time-stamp-time-zone: "UTC0" | |
213 | 213 | # time-stamp-end: "; # UTC" |
214 | 214 | # End: |
0 | 0 | #! /bin/sh |
1 | 1 | # test-driver - basic testsuite driver script. |
2 | 2 | |
3 | scriptversion=2013-07-13.22; # UTC | |
3 | scriptversion=2018-03-07.03; # UTC | |
4 | 4 | |
5 | # Copyright (C) 2011-2014 Free Software Foundation, Inc. | |
5 | # Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
6 | 6 | # |
7 | 7 | # This program is free software; you can redistribute it and/or modify |
8 | 8 | # it under the terms of the GNU General Public License as published by |
15 | 15 | # GNU General Public License for more details. |
16 | 16 | # |
17 | 17 | # You should have received a copy of the GNU General Public License |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
19 | 19 | |
20 | 20 | # As a special exception to the GNU General Public License, if you |
21 | 21 | # distribute this file as part of a program that contains a |
139 | 139 | # Local Variables: |
140 | 140 | # mode: shell-script |
141 | 141 | # sh-indentation: 2 |
142 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
142 | # eval: (add-hook 'before-save-hook 'time-stamp) | |
143 | 143 | # time-stamp-start: "scriptversion=" |
144 | 144 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
145 | # time-stamp-time-zone: "UTC" | |
145 | # time-stamp-time-zone: "UTC0" | |
146 | 146 | # time-stamp-end: "; # UTC" |
147 | 147 | # End: |
0 | #!/bin/sh | |
1 | #! -*-perl-*- | |
2 | ||
3 | # Update an FSF copyright year list to include the current year. | |
4 | ||
5 | # Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
6 | # | |
7 | # This program is free software: you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation; either version 3, or (at your option) | |
10 | # any later version. | |
11 | # | |
12 | # This program is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public License | |
18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
19 | # | |
20 | # Written by Jim Meyering and Joel E. Denny | |
21 | ||
22 | # This script updates an FSF copyright year list to include the current year. | |
23 | # Usage: update-copyright [FILE...] | |
24 | # | |
25 | # The arguments to this script should be names of files that contain | |
26 | # copyright statements to be updated. The copyright holder's name | |
27 | # defaults to "Free Software Foundation, Inc." but may be changed to | |
28 | # any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment | |
29 | # variable. | |
30 | # | |
31 | # For example, you might wish to use the update-copyright target rule | |
32 | # in maint.mk from gnulib's maintainer-makefile module. | |
33 | # | |
34 | # Iff a copyright statement is recognized in a file and the final | |
35 | # year is not the current year, then the statement is updated for the | |
36 | # new year and it is reformatted to: | |
37 | # | |
38 | # 1. Fit within 72 columns. | |
39 | # 2. Convert 2-digit years to 4-digit years by prepending "19". | |
40 | # 3. Expand copyright year intervals. (See "Environment variables" | |
41 | # below.) | |
42 | # | |
43 | # A warning is printed for every file for which no copyright | |
44 | # statement is recognized. | |
45 | # | |
46 | # Each file's copyright statement must be formatted correctly in | |
47 | # order to be recognized. For example, each of these is fine: | |
48 | # | |
49 | # Copyright @copyright{} 1990-2005, 2007-2009 Free Software | |
50 | # Foundation, Inc. | |
51 | # | |
52 | # # Copyright (C) 1990-2005, 2007-2009 Free Software | |
53 | # # Foundation, Inc. | |
54 | # | |
55 | # /* | |
56 | # * Copyright © 90,2005,2007-2009 | |
57 | # * Free Software Foundation, Inc. | |
58 | # */ | |
59 | # | |
60 | # However, the following format is not recognized because the line | |
61 | # prefix changes after the first line: | |
62 | # | |
63 | # ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
64 | # # Foundation, Inc. | |
65 | # | |
66 | # However, any correctly formatted copyright statement following | |
67 | # a non-matching copyright statements would be recognized. | |
68 | # | |
69 | # The exact conditions that a file's copyright statement must meet | |
70 | # to be recognized are: | |
71 | # | |
72 | # 1. It is the first copyright statement that meets all of the | |
73 | # following conditions. Subsequent copyright statements are | |
74 | # ignored. | |
75 | # 2. Its format is "Copyright (C)", then a list of copyright years, | |
76 | # and then the name of the copyright holder. | |
77 | # 3. The "(C)" takes one of the following forms or is omitted | |
78 | # entirely: | |
79 | # | |
80 | # A. (C) | |
81 | # B. (c) | |
82 | # C. @copyright{} | |
83 | # D. © | |
84 | # E. © | |
85 | # | |
86 | # 4. The "Copyright" appears at the beginning of a line, except that it | |
87 | # may be prefixed by any sequence (e.g., a comment) of no more than | |
88 | # 5 characters -- including white space. | |
89 | # 5. Iff such a prefix is present, the same prefix appears at the | |
90 | # beginning of each remaining line within the FSF copyright | |
91 | # statement. There is one exception in order to support C-style | |
92 | # comments: if the first line's prefix contains nothing but | |
93 | # whitespace surrounding a "/*", then the prefix for all subsequent | |
94 | # lines is the same as the first line's prefix except with each of | |
95 | # "/" and possibly "*" replaced by a " ". The replacement of "*" | |
96 | # by " " is consistent throughout all subsequent lines. | |
97 | # 6. Blank lines, even if preceded by the prefix, do not appear | |
98 | # within the FSF copyright statement. | |
99 | # 7. Each copyright year is 2 or 4 digits, and years are separated by | |
100 | # commas, "-", or "--". Whitespace may appear after commas. | |
101 | # | |
102 | # Environment variables: | |
103 | # | |
104 | # 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement | |
105 | # is reformatted even if it does not need updating for the new | |
106 | # year. If unset or set to 0, only updated FSF copyright | |
107 | # statements are reformatted. | |
108 | # 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive | |
109 | # copyright years (such as 90, 1991, 1992-2007, 2008) in a | |
110 | # reformatted FSF copyright statement is collapsed to a single | |
111 | # interval (such as 1990-2008). If unset or set to 0, all existing | |
112 | # copyright year intervals in a reformatted FSF copyright statement | |
113 | # are expanded instead. | |
114 | # If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps | |
115 | # to the minimal containing range. For example, convert | |
116 | # 2000, 2004-2007, 2009 to 2000-2009. | |
117 | # 3. For testing purposes, you can set the assumed current year in | |
118 | # UPDATE_COPYRIGHT_YEAR. | |
119 | # 4. The default maximum line length for a copyright line is 72. | |
120 | # Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length. | |
121 | # 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other | |
122 | # than "Free Software Foundation, Inc.". | |
123 | ||
124 | # This is a prologue that allows to run a perl script as an executable | |
125 | # on systems that are compliant to a POSIX version before POSIX:2017. | |
126 | # On such systems, the usual invocation of an executable through execlp() | |
127 | # or execvp() fails with ENOEXEC if it is a script that does not start | |
128 | # with a #! line. The script interpreter mentioned in the #! line has | |
129 | # to be /bin/sh, because on GuixSD systems that is the only program that | |
130 | # has a fixed file name. The second line is essential for perl and is | |
131 | # also useful for editing this file in Emacs. The next two lines below | |
132 | # are valid code in both sh and perl. When executed by sh, they re-execute | |
133 | # the script through the perl program found in $PATH. The '-x' option | |
134 | # is essential as well; without it, perl would re-execute the script | |
135 | # through /bin/sh. When executed by perl, the next two lines are a no-op. | |
136 | eval 'exec perl -wSx -0777 -pi "$0" "$@"' | |
137 | if 0; | |
138 | ||
139 | my $VERSION = '2020-04-04.15:07'; # UTC | |
140 | # The definition above must lie within the first 8 lines in order | |
141 | # for the Emacs time-stamp write hook (at end) to update it. | |
142 | # If you change this file with Emacs, please let the write hook | |
143 | # do its job. Otherwise, update this string manually. | |
144 | ||
145 | use strict; | |
146 | use warnings; | |
147 | ||
148 | my $copyright_re = 'Copyright'; | |
149 | my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©|©)'; | |
150 | my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; | |
151 | $holder ||= 'Free Software Foundation, Inc.'; | |
152 | my $prefix_max = 5; | |
153 | my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH}; | |
154 | !$margin || $margin !~ m/^\d+$/ | |
155 | and $margin = 72; | |
156 | ||
157 | my $tab_width = 8; | |
158 | ||
159 | my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR}; | |
160 | if (!$this_year || $this_year !~ m/^\d{4}$/) | |
161 | { | |
162 | my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ()); | |
163 | $this_year = $year + 1900; | |
164 | } | |
165 | ||
166 | # Unless the file consistently uses "\r\n" as the EOL, use "\n" instead. | |
167 | my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n"; | |
168 | ||
169 | my $leading; | |
170 | my $prefix; | |
171 | my $ws_re; | |
172 | my $stmt_re; | |
173 | while (/(^|\n)(.{0,$prefix_max})$copyright_re/g) | |
174 | { | |
175 | $leading = "$1$2"; | |
176 | $prefix = $2; | |
177 | if ($prefix =~ /^(\s*\/)\*(\s*)$/) | |
178 | { | |
179 | $prefix =~ s,/, ,; | |
180 | my $prefix_ws = $prefix; | |
181 | $prefix_ws =~ s/\*/ /; # Only whitespace. | |
182 | if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/) | |
183 | { | |
184 | $prefix = $prefix_ws; | |
185 | } | |
186 | } | |
187 | $ws_re = '[ \t\r\f]'; # \s without \n | |
188 | $ws_re = | |
189 | "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)"; | |
190 | my $holder_re = $holder; | |
191 | $holder_re =~ s/\s/$ws_re/g; | |
192 | my $stmt_remainder_re = | |
193 | "(?:$ws_re$circle_c_re)?" | |
194 | . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|--?))*" | |
195 | . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re"; | |
196 | if (/\G$stmt_remainder_re/) | |
197 | { | |
198 | $stmt_re = | |
199 | quotemeta($leading) . "($copyright_re$stmt_remainder_re)"; | |
200 | last; | |
201 | } | |
202 | } | |
203 | if (defined $stmt_re) | |
204 | { | |
205 | /$stmt_re/ or die; # Should never die. | |
206 | my $stmt = $1; | |
207 | my $final_year_orig = $2; | |
208 | ||
209 | # Handle two-digit year numbers like "98" and "99". | |
210 | my $final_year = $final_year_orig; | |
211 | $final_year <= 99 | |
212 | and $final_year += 1900; | |
213 | ||
214 | if ($final_year != $this_year) | |
215 | { | |
216 | # Update the year. | |
217 | $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/; | |
218 | } | |
219 | if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'}) | |
220 | { | |
221 | # Normalize all whitespace including newline-prefix sequences. | |
222 | $stmt =~ s/$ws_re/ /g; | |
223 | ||
224 | # Put spaces after commas. | |
225 | $stmt =~ s/, ?/, /g; | |
226 | ||
227 | # Convert 2-digit to 4-digit years. | |
228 | $stmt =~ s/(\b\d\d\b)/19$1/g; | |
229 | ||
230 | # Make the use of intervals consistent. | |
231 | if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS}) | |
232 | { | |
233 | $stmt =~ s/(\d{4})--?(\d{4})/join(', ', $1..$2)/eg; | |
234 | } | |
235 | else | |
236 | { | |
237 | my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-"; | |
238 | ||
239 | $stmt =~ | |
240 | s/ | |
241 | (\d{4}) | |
242 | (?: | |
243 | (,\ |--?) | |
244 | ((??{ | |
245 | if ($2 ne ', ') { '\d{4}'; } | |
246 | elsif (!$3) { $1 + 1; } | |
247 | else { $3 + 1; } | |
248 | })) | |
249 | )+ | |
250 | /$1$ndash$3/gx; | |
251 | ||
252 | # When it's 2, emit a single range encompassing all year numbers. | |
253 | $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2 | |
254 | and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1$ndash$2/; | |
255 | } | |
256 | ||
257 | # Format within margin. | |
258 | my $stmt_wrapped; | |
259 | my $text_margin = $margin - length($prefix); | |
260 | if ($prefix =~ /^(\t+)/) | |
261 | { | |
262 | $text_margin -= length($1) * ($tab_width - 1); | |
263 | } | |
264 | while (length $stmt) | |
265 | { | |
266 | if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//) | |
267 | || ($stmt =~ s/^([\S]+)(?: |$)//)) | |
268 | { | |
269 | my $line = $1; | |
270 | $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading; | |
271 | $stmt_wrapped .= $line; | |
272 | } | |
273 | else | |
274 | { | |
275 | # Should be unreachable, but we don't want an infinite | |
276 | # loop if it can be reached. | |
277 | die; | |
278 | } | |
279 | } | |
280 | ||
281 | # Replace the old copyright statement. | |
282 | s/$stmt_re/$stmt_wrapped/; | |
283 | } | |
284 | } | |
285 | else | |
286 | { | |
287 | print STDERR "$ARGV: warning: copyright statement not found\n"; | |
288 | } | |
289 | ||
290 | # Hey Emacs! | |
291 | # Local variables: | |
292 | # coding: utf-8 | |
293 | # mode: perl | |
294 | # indent-tabs-mode: nil | |
295 | # eval: (add-hook 'before-save-hook 'time-stamp) | |
296 | # time-stamp-line-limit: 200 | |
297 | # time-stamp-start: "my $VERSION = '" | |
298 | # time-stamp-format: "%:y-%02m-%02d.%02H:%02M" | |
299 | # time-stamp-time-zone: "UTC0" | |
300 | # time-stamp-end: "'; # UTC" | |
301 | # End: |
0 | eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"' | |
1 | & eval 'exec perl -wST "$0" $argv:q' | |
2 | if 0; | |
0 | #!/bin/sh | |
1 | #! -*-perl-*- | |
2 | ||
3 | 3 | # Detect instances of "if (p) free (p);". |
4 | 4 | # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. |
5 | 5 | |
6 | my $VERSION = '2018-03-07 03:47'; # UTC | |
6 | # Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
7 | # | |
8 | # This program is free software: you can redistribute it and/or modify | |
9 | # it under the terms of the GNU General Public License as published by | |
10 | # the Free Software Foundation, either version 3 of the License, or | |
11 | # (at your option) any later version. | |
12 | # | |
13 | # This program is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | # GNU General Public License for more details. | |
17 | # | |
18 | # You should have received a copy of the GNU General Public License | |
19 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
20 | # | |
21 | # Written by Jim Meyering | |
22 | ||
23 | # This is a prologue that allows to run a perl script as an executable | |
24 | # on systems that are compliant to a POSIX version before POSIX:2017. | |
25 | # On such systems, the usual invocation of an executable through execlp() | |
26 | # or execvp() fails with ENOEXEC if it is a script that does not start | |
27 | # with a #! line. The script interpreter mentioned in the #! line has | |
28 | # to be /bin/sh, because on GuixSD systems that is the only program that | |
29 | # has a fixed file name. The second line is essential for perl and is | |
30 | # also useful for editing this file in Emacs. The next two lines below | |
31 | # are valid code in both sh and perl. When executed by sh, they re-execute | |
32 | # the script through the perl program found in $PATH. The '-x' option | |
33 | # is essential as well; without it, perl would re-execute the script | |
34 | # through /bin/sh. When executed by perl, the next two lines are a no-op. | |
35 | eval 'exec perl -wSx "$0" "$@"' | |
36 | if 0; | |
37 | ||
38 | my $VERSION = '2020-04-04 15:07'; # UTC | |
7 | 39 | # The definition above must lie within the first 8 lines in order |
8 | 40 | # for the Emacs time-stamp write hook (at end) to update it. |
9 | 41 | # If you change this file with Emacs, please let the write hook |
10 | 42 | # do its job. Otherwise, update this string manually. |
11 | ||
12 | # Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
13 | ||
14 | # This program is free software: you can redistribute it and/or modify | |
15 | # it under the terms of the GNU General Public License as published by | |
16 | # the Free Software Foundation, either version 3 of the License, or | |
17 | # (at your option) any later version. | |
18 | ||
19 | # This program is distributed in the hope that it will be useful, | |
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | # GNU General Public License for more details. | |
23 | ||
24 | # You should have received a copy of the GNU General Public License | |
25 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
26 | ||
27 | # Written by Jim Meyering | |
28 | 43 | |
29 | 44 | use strict; |
30 | 45 | use warnings; |
202 | 217 | ## mode: perl |
203 | 218 | ## indent-tabs-mode: nil |
204 | 219 | ## eval: (add-hook 'before-save-hook 'time-stamp) |
220 | ## time-stamp-line-limit: 50 | |
205 | 221 | ## time-stamp-start: "my $VERSION = '" |
206 | 222 | ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" |
207 | 223 | ## time-stamp-time-zone: "UTC0" |
3 | 3 | # Print a version string. |
4 | 4 | scriptversion=2018-03-07.03; # UTC |
5 | 5 | |
6 | # Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
6 | # Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
7 | 7 | |
8 | 8 | # This program is free software: you can redistribute it and/or modify |
9 | 9 | # it under the terms of the GNU General Public License as published by |
24 | 24 | # list the version-controlled files in that directory. |
25 | 25 | |
26 | 26 | # If there's an argument, it must be a single, "."-relative directory name. |
27 | # cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/ | |
27 | # cvsu is part of the cvsutils package: https://www.red-bean.com/cvsutils/ | |
28 | 28 | |
29 | 29 | postprocess= |
30 | 30 | case $1 in |
0 | # Copyright (C) 2006-2018 Simon Josefsson. | |
0 | # Copyright (C) 2006-2020 Simon Josefsson. | |
1 | 1 | # |
2 | 2 | # This file is part of Libntlm. |
3 | 3 | # |
102 | 102 | |
103 | 103 | /* Define to 1 if the system has the type `_Bool'. */ |
104 | 104 | #undef HAVE__BOOL |
105 | ||
106 | /* Define to 1 if the compiler supports the keyword '__inline'. */ | |
107 | #undef HAVE___INLINE | |
105 | 108 | |
106 | 109 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ |
107 | 110 | #undef LT_OBJDIR |
248 | 251 | #undef _NETBSD_SOURCE |
249 | 252 | |
250 | 253 | /* The _Noreturn keyword of C11. */ |
251 | #if ! (defined _Noreturn \ | |
252 | || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) | |
253 | # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ | |
254 | || 0x5110 <= __SUNPRO_C) | |
254 | #ifndef _Noreturn | |
255 | # if (defined __cplusplus \ | |
256 | && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ | |
257 | || (defined _MSC_VER && 1900 <= _MSC_VER)) \ | |
258 | && 0) | |
259 | /* [[noreturn]] is not practically usable, because with it the syntax | |
260 | extern _Noreturn void func (...); | |
261 | would not be valid; such a declaration would only be valid with 'extern' | |
262 | and '_Noreturn' swapped, or without the 'extern' keyword. However, some | |
263 | AIX system header files and several gnulib header files use precisely | |
264 | this syntax with 'extern'. */ | |
265 | # define _Noreturn [[noreturn]] | |
266 | # elif ((!defined __cplusplus || defined __clang__) \ | |
267 | && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ | |
268 | || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ | |
269 | || (defined __apple_build_version__ \ | |
270 | ? 6000000 <= __apple_build_version__ \ | |
271 | : 3 < __clang_major__ + (5 <= __clang_minor__)))) | |
272 | /* _Noreturn works as-is. */ | |
273 | # elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C | |
255 | 274 | # define _Noreturn __attribute__ ((__noreturn__)) |
256 | # elif defined _MSC_VER && 1200 <= _MSC_VER | |
275 | # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) | |
257 | 276 | # define _Noreturn __declspec (noreturn) |
258 | 277 | # else |
259 | 278 | # define _Noreturn |
276 | 295 | |
277 | 296 | /* Define to 1 if the system <stdint.h> predates C++11. */ |
278 | 297 | #undef __STDC_LIMIT_MACROS |
298 | ||
299 | /* The _GL_ASYNC_SAFE marker should be attached to functions that are | |
300 | signal handlers (for signals other than SIGABRT, SIGPIPE) or can be | |
301 | invoked from such signal handlers. Such functions have some restrictions: | |
302 | * All functions that it calls should be marked _GL_ASYNC_SAFE as well, | |
303 | or should be listed as async-signal-safe in POSIX | |
304 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04> | |
305 | section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in | |
306 | particular, are NOT async-signal-safe. | |
307 | * All memory locations (variables and struct fields) that these functions | |
308 | access must be marked 'volatile'. This holds for both read and write | |
309 | accesses. Otherwise the compiler might optimize away stores to and | |
310 | reads from such locations that occur in the program, depending on its | |
311 | data flow analysis. For example, when the program contains a loop | |
312 | that is intended to inspect a variable set from within a signal handler | |
313 | while (!signal_occurred) | |
314 | ; | |
315 | the compiler is allowed to transform this into an endless loop if the | |
316 | variable 'signal_occurred' is not declared 'volatile'. | |
317 | Additionally, recall that: | |
318 | * A signal handler should not modify errno (except if it is a handler | |
319 | for a fatal signal and ends by raising the same signal again, thus | |
320 | provoking the termination of the process). If it invokes a function | |
321 | that may clobber errno, it needs to save and restore the value of | |
322 | errno. */ | |
323 | #define _GL_ASYNC_SAFE | |
324 | ||
279 | 325 | |
280 | 326 | /* Rename to public API name. */ |
281 | 327 | #undef check_version |
304 | 350 | https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html |
305 | 351 | |
306 | 352 | DragonFly; see |
307 | http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log | |
353 | http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log | |
308 | 354 | |
309 | 355 | FreeBSD; see: |
310 | 356 | https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html |
410 | 456 | nothing if this is not supported. Do not define if restrict is |
411 | 457 | supported directly. */ |
412 | 458 | #undef restrict |
413 | /* Work around a bug in Sun C++: it does not support _Restrict or | |
414 | __restrict__, even though the corresponding Sun C compiler ends up with | |
415 | "#define restrict _Restrict" or "#define restrict __restrict__" in the | |
416 | previous line. Perhaps some future version of Sun C++ will work with | |
417 | restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ | |
418 | #if defined __SUNPRO_CC && !defined __RESTRICT | |
459 | /* Work around a bug in older versions of Sun C++, which did not | |
460 | #define __restrict__ or support _Restrict or __restrict__ | |
461 | even though the corresponding Sun C compiler ended up with | |
462 | "#define restrict _Restrict" or "#define restrict __restrict__" | |
463 | in the previous line. This workaround can be removed once | |
464 | we assume Oracle Developer Studio 12.5 (2016) or later. */ | |
465 | #if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__ | |
419 | 466 | # define _Restrict |
420 | 467 | # define __restrict__ |
421 | 468 | #endif |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for libntlm 1.5. | |
2 | # Generated by GNU Autoconf 2.69 for libntlm 1.6. | |
3 | 3 | # |
4 | 4 | # Report bugs to <libntlm@nongnu.org>. |
5 | 5 | # |
589 | 589 | # Identity of this package. |
590 | 590 | PACKAGE_NAME='libntlm' |
591 | 591 | PACKAGE_TARNAME='libntlm' |
592 | PACKAGE_VERSION='1.5' | |
593 | PACKAGE_STRING='libntlm 1.5' | |
592 | PACKAGE_VERSION='1.6' | |
593 | PACKAGE_STRING='libntlm 1.6' | |
594 | 594 | PACKAGE_BUGREPORT='libntlm@nongnu.org' |
595 | 595 | PACKAGE_URL='' |
596 | 596 | |
648 | 648 | HAVE_FEATURES_H |
649 | 649 | NEXT_AS_FIRST_DIRECTIVE_WCHAR_H |
650 | 650 | NEXT_WCHAR_H |
651 | REPLACE_WCSTOK | |
651 | 652 | REPLACE_WCSFTIME |
652 | 653 | REPLACE_WCSWIDTH |
653 | 654 | REPLACE_WCWIDTH |
803 | 804 | REPLACE_DUP |
804 | 805 | REPLACE_CLOSE |
805 | 806 | REPLACE_CHOWN |
807 | REPLACE_ACCESS | |
806 | 808 | HAVE_SYS_PARAM_H |
807 | 809 | HAVE_OS_H |
808 | 810 | HAVE_DECL_TTYNAME_R |
847 | 849 | HAVE_EUIDACCESS |
848 | 850 | HAVE_DUP3 |
849 | 851 | HAVE_DUP2 |
852 | HAVE_COPY_FILE_RANGE | |
850 | 853 | HAVE_CHOWN |
851 | 854 | GNULIB_WRITE |
852 | 855 | GNULIB_USLEEP |
877 | 880 | GNULIB_GETUSERSHELL |
878 | 881 | GNULIB_GETPASS |
879 | 882 | GNULIB_GETPAGESIZE |
883 | GNULIB_GETOPT_POSIX | |
880 | 884 | GNULIB_GETLOGIN_R |
881 | 885 | GNULIB_GETLOGIN |
882 | 886 | GNULIB_GETHOSTNAME |
895 | 899 | GNULIB_DUP3 |
896 | 900 | GNULIB_DUP2 |
897 | 901 | GNULIB_DUP |
902 | GNULIB_COPY_FILE_RANGE | |
898 | 903 | GNULIB_CLOSE |
899 | 904 | GNULIB_CHOWN |
900 | 905 | GNULIB_CHDIR |
906 | GNULIB_ACCESS | |
901 | 907 | WINDOWS_STAT_INODES |
902 | 908 | WINDOWS_64_BIT_OFF_T |
903 | 909 | NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H |
1004 | 1010 | HAVE_SYS_TYPES_H |
1005 | 1011 | HAVE_INTTYPES_H |
1006 | 1012 | HAVE_WCHAR_H |
1007 | HAVE_UNSIGNED_LONG_LONG_INT | |
1008 | HAVE_LONG_LONG_INT | |
1009 | 1013 | GNULIB_OVERRIDES_WINT_T |
1010 | 1014 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H |
1011 | 1015 | NEXT_STDDEF_H |
1077 | 1081 | AMDEPBACKSLASH |
1078 | 1082 | AMDEP_FALSE |
1079 | 1083 | AMDEP_TRUE |
1080 | am__quote | |
1081 | 1084 | am__include |
1082 | 1085 | DEPDIR |
1083 | 1086 | OBJEXT |
1155 | 1158 | PACKAGE_TARNAME |
1156 | 1159 | PACKAGE_NAME |
1157 | 1160 | PATH_SEPARATOR |
1158 | SHELL' | |
1161 | SHELL | |
1162 | am__quote' | |
1159 | 1163 | ac_subst_files='' |
1160 | 1164 | ac_user_opts=' |
1161 | 1165 | enable_option_checking |
1169 | 1173 | with_gnu_ld |
1170 | 1174 | with_sysroot |
1171 | 1175 | enable_libtool_lock |
1176 | enable_cross_guesses | |
1172 | 1177 | enable_valgrind_tests |
1173 | 1178 | ' |
1174 | 1179 | ac_precious_vars='build_alias |
1731 | 1736 | # Omit some internal or obsolete options to make the list less imposing. |
1732 | 1737 | # This message is too long to be a string in the A/UX 3.1 sh. |
1733 | 1738 | cat <<_ACEOF |
1734 | \`configure' configures libntlm 1.5 to adapt to many kinds of systems. | |
1739 | \`configure' configures libntlm 1.6 to adapt to many kinds of systems. | |
1735 | 1740 | |
1736 | 1741 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1737 | 1742 | |
1802 | 1807 | |
1803 | 1808 | if test -n "$ac_init_help"; then |
1804 | 1809 | case $ac_init_help in |
1805 | short | recursive ) echo "Configuration of libntlm 1.5:";; | |
1810 | short | recursive ) echo "Configuration of libntlm 1.6:";; | |
1806 | 1811 | esac |
1807 | 1812 | cat <<\_ACEOF |
1808 | 1813 | |
1821 | 1826 | --enable-fast-install[=PKGS] |
1822 | 1827 | optimize for fast installation [default=yes] |
1823 | 1828 | --disable-libtool-lock avoid locking (might break parallel builds) |
1829 | --enable-cross-guesses={conservative|risky} | |
1830 | specify policy for cross-compilation guesses | |
1824 | 1831 | --disable-valgrind-tests |
1825 | 1832 | don't try to run self tests under valgrind |
1826 | 1833 | |
1914 | 1921 | test -n "$ac_init_help" && exit $ac_status |
1915 | 1922 | if $ac_init_version; then |
1916 | 1923 | cat <<\_ACEOF |
1917 | libntlm configure 1.5 | |
1924 | libntlm configure 1.6 | |
1918 | 1925 | generated by GNU Autoconf 2.69 |
1919 | 1926 | |
1920 | 1927 | Copyright (C) 2012 Free Software Foundation, Inc. |
2520 | 2527 | This file contains any messages produced by compilers while |
2521 | 2528 | running configure, to aid debugging if configure makes a mistake. |
2522 | 2529 | |
2523 | It was created by libntlm $as_me 1.5, which was | |
2530 | It was created by libntlm $as_me 1.6, which was | |
2524 | 2531 | generated by GNU Autoconf 2.69. Invocation command line was |
2525 | 2532 | |
2526 | 2533 | $ $0 $@ |
2913 | 2920 | |
2914 | 2921 | LT_AGE=0 |
2915 | 2922 | |
2916 | LT_REVISION=20 | |
2917 | ||
2918 | ||
2919 | am__api_version='1.15' | |
2923 | LT_REVISION=21 | |
2924 | ||
2925 | ||
2926 | am__api_version='1.16' | |
2920 | 2927 | |
2921 | 2928 | # Find a good install program. We prefer a C program (faster), |
2922 | 2929 | # so one script is as good as another. But avoid the broken or |
3402 | 3409 | |
3403 | 3410 | # Define the identity of the package. |
3404 | 3411 | PACKAGE='libntlm' |
3405 | VERSION='1.5' | |
3412 | VERSION='1.6' | |
3406 | 3413 | |
3407 | 3414 | |
3408 | 3415 | cat >>confdefs.h <<_ACEOF |
3432 | 3439 | |
3433 | 3440 | # For better backward compatibility. To be removed once Automake 1.9.x |
3434 | 3441 | # dies out for good. For more background, see: |
3435 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
3436 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
3442 | # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
3443 | # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
3437 | 3444 | mkdir_p='$(MKDIR_P)' |
3438 | 3445 | |
3439 | 3446 | # We need awk for the "check" target (and possibly the TAP driver). The |
3484 | 3491 | Aborting the configuration process, to ensure you take notice of the issue. |
3485 | 3492 | |
3486 | 3493 | You can download and install GNU coreutils to get an 'rm' implementation |
3487 | that behaves properly: <http://www.gnu.org/software/coreutils/>. | |
3494 | that behaves properly: <https://www.gnu.org/software/coreutils/>. | |
3488 | 3495 | |
3489 | 3496 | If you want to complete the configuration process using your problematic |
3490 | 3497 | 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM |
4347 | 4354 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
4348 | 4355 | ac_compiler_gnu=$ac_cv_c_compiler_gnu |
4349 | 4356 | |
4357 | ||
4358 | ||
4359 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5 | |
4360 | $as_echo_n "checking whether the compiler is clang... " >&6; } | |
4361 | if ${gl_cv_compiler_clang+:} false; then : | |
4362 | $as_echo_n "(cached) " >&6 | |
4363 | else | |
4364 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4365 | /* end confdefs.h. */ | |
4366 | ||
4367 | #ifdef __clang__ | |
4368 | barfbarf | |
4369 | #endif | |
4370 | ||
4371 | int | |
4372 | main () | |
4373 | { | |
4374 | ||
4375 | ; | |
4376 | return 0; | |
4377 | } | |
4378 | ||
4379 | _ACEOF | |
4380 | if ac_fn_c_try_compile "$LINENO"; then : | |
4381 | gl_cv_compiler_clang=no | |
4382 | else | |
4383 | gl_cv_compiler_clang=yes | |
4384 | fi | |
4385 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4386 | ||
4387 | fi | |
4388 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5 | |
4389 | $as_echo "$gl_cv_compiler_clang" >&6; } | |
4390 | ||
4391 | ||
4392 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5 | |
4393 | $as_echo_n "checking for compiler option needed when checking for declarations... " >&6; } | |
4394 | if ${gl_cv_compiler_check_decl_option+:} false; then : | |
4395 | $as_echo_n "(cached) " >&6 | |
4396 | else | |
4397 | if test $gl_cv_compiler_clang = yes; then | |
4398 | save_ac_compile="$ac_compile" | |
4399 | ac_compile="$ac_compile -Werror=implicit-function-declaration" | |
4400 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4401 | /* end confdefs.h. */ | |
4402 | ||
4403 | int | |
4404 | main () | |
4405 | { | |
4406 | ||
4407 | ; | |
4408 | return 0; | |
4409 | } | |
4410 | _ACEOF | |
4411 | if ac_fn_c_try_compile "$LINENO"; then : | |
4412 | gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration' | |
4413 | else | |
4414 | gl_cv_compiler_check_decl_option=none | |
4415 | fi | |
4416 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4417 | ac_compile="$save_ac_compile" | |
4418 | else | |
4419 | gl_cv_compiler_check_decl_option=none | |
4420 | fi | |
4421 | ||
4422 | fi | |
4423 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5 | |
4424 | $as_echo "$gl_cv_compiler_check_decl_option" >&6; } | |
4425 | if test "x$gl_cv_compiler_check_decl_option" != xnone; then | |
4426 | ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option" | |
4427 | else | |
4428 | ac_compile_for_check_decl="$ac_compile" | |
4429 | fi | |
4430 | ||
4350 | 4431 | DEPDIR="${am__leading_dot}deps" |
4351 | 4432 | |
4352 | 4433 | ac_config_commands="$ac_config_commands depfiles" |
4353 | 4434 | |
4354 | ||
4355 | am_make=${MAKE-make} | |
4356 | cat > confinc << 'END' | |
4435 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 | |
4436 | $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } | |
4437 | cat > confinc.mk << 'END' | |
4357 | 4438 | am__doit: |
4358 | @echo this is the am__doit target | |
4439 | @echo this is the am__doit target >confinc.out | |
4359 | 4440 | .PHONY: am__doit |
4360 | 4441 | END |
4361 | # If we don't find an include directive, just comment out the code. | |
4362 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 | |
4363 | $as_echo_n "checking for style of include used by $am_make... " >&6; } | |
4364 | 4442 | am__include="#" |
4365 | 4443 | am__quote= |
4366 | _am_result=none | |
4367 | # First try GNU make style include. | |
4368 | echo "include confinc" > confmf | |
4369 | # Ignore all kinds of additional output from 'make'. | |
4370 | case `$am_make -s -f confmf 2> /dev/null` in #( | |
4371 | *the\ am__doit\ target*) | |
4372 | am__include=include | |
4373 | am__quote= | |
4374 | _am_result=GNU | |
4375 | ;; | |
4444 | # BSD make does it like this. | |
4445 | echo '.include "confinc.mk" # ignored' > confmf.BSD | |
4446 | # Other make implementations (GNU, Solaris 10, AIX) do it like this. | |
4447 | echo 'include confinc.mk # ignored' > confmf.GNU | |
4448 | _am_result=no | |
4449 | for s in GNU BSD; do | |
4450 | { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 | |
4451 | (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 | |
4452 | ac_status=$? | |
4453 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
4454 | (exit $ac_status); } | |
4455 | case $?:`cat confinc.out 2>/dev/null` in #( | |
4456 | '0:this is the am__doit target') : | |
4457 | case $s in #( | |
4458 | BSD) : | |
4459 | am__include='.include' am__quote='"' ;; #( | |
4460 | *) : | |
4461 | am__include='include' am__quote='' ;; | |
4462 | esac ;; #( | |
4463 | *) : | |
4464 | ;; | |
4376 | 4465 | esac |
4377 | # Now try BSD make style include. | |
4378 | if test "$am__include" = "#"; then | |
4379 | echo '.include "confinc"' > confmf | |
4380 | case `$am_make -s -f confmf 2> /dev/null` in #( | |
4381 | *the\ am__doit\ target*) | |
4382 | am__include=.include | |
4383 | am__quote="\"" | |
4384 | _am_result=BSD | |
4385 | ;; | |
4386 | esac | |
4387 | fi | |
4388 | ||
4389 | ||
4390 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 | |
4391 | $as_echo "$_am_result" >&6; } | |
4392 | rm -f confinc confmf | |
4466 | if test "$am__include" != "#"; then | |
4467 | _am_result="yes ($s style)" | |
4468 | break | |
4469 | fi | |
4470 | done | |
4471 | rm -f confinc.* confmf.* | |
4472 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 | |
4473 | $as_echo "${_am_result}" >&6; } | |
4393 | 4474 | |
4394 | 4475 | # Check whether --enable-dependency-tracking was given. |
4395 | 4476 | if test "${enable_dependency_tracking+set}" = set; then : |
5615 | 5696 | # Code from module inttypes: |
5616 | 5697 | # Code from module inttypes-incomplete: |
5617 | 5698 | # Code from module inttypes-tests: |
5699 | # Code from module libc-config: | |
5618 | 5700 | # Code from module limits-h: |
5619 | 5701 | # Code from module limits-h-tests: |
5620 | 5702 | # Code from module maintainer-makefile: |
5642 | 5724 | # Code from module test-framework-sh-tests: |
5643 | 5725 | # Code from module unistd: |
5644 | 5726 | # Code from module unistd-tests: |
5727 | # Code from module update-copyright: | |
5728 | # Code from module update-copyright-tests: | |
5645 | 5729 | # Code from module useless-if-before-free: |
5646 | 5730 | # Code from module valgrind-tests: |
5647 | 5731 | # Code from module vc-list-files: |
8091 | 8175 | test $ac_status = 0; }; then |
8092 | 8176 | # Now try to grab the symbols. |
8093 | 8177 | nlist=conftest.nm |
8094 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 | |
8095 | (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 | |
8096 | ac_status=$? | |
8097 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
8098 | test $ac_status = 0; } && test -s "$nlist"; then | |
8178 | $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 | |
8179 | if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then | |
8099 | 8180 | # Try sorting and uniquifying the output. |
8100 | 8181 | if sort "$nlist" | uniq > "$nlist"T; then |
8101 | 8182 | mv -f "$nlist"T "$nlist" |
13966 | 14047 | |
13967 | 14048 | |
13968 | 14049 | |
14050 | ||
14051 | # Check whether --enable-cross-guesses was given. | |
14052 | if test "${enable_cross_guesses+set}" = set; then : | |
14053 | enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then | |
14054 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5 | |
14055 | $as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;} | |
14056 | enableval=conservative | |
14057 | fi | |
14058 | gl_cross_guesses="$enableval" | |
14059 | else | |
14060 | gl_cross_guesses=conservative | |
14061 | fi | |
14062 | ||
14063 | if test $gl_cross_guesses = risky; then | |
14064 | gl_cross_guess_normal="guessing yes" | |
14065 | gl_cross_guess_inverted="guessing no" | |
14066 | else | |
14067 | gl_cross_guess_normal="guessing no" | |
14068 | gl_cross_guess_inverted="guessing yes" | |
14069 | fi | |
13969 | 14070 | LIBC_FATAL_STDERR_=1 |
13970 | 14071 | export LIBC_FATAL_STDERR_ |
14072 | ||
14073 | ||
14074 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 | |
14075 | $as_echo_n "checking for C/C++ restrict keyword... " >&6; } | |
14076 | if ${ac_cv_c_restrict+:} false; then : | |
14077 | $as_echo_n "(cached) " >&6 | |
14078 | else | |
14079 | ac_cv_c_restrict=no | |
14080 | # The order here caters to the fact that C++ does not require restrict. | |
14081 | for ac_kw in __restrict __restrict__ _Restrict restrict; do | |
14082 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14083 | /* end confdefs.h. */ | |
14084 | typedef int *int_ptr; | |
14085 | int foo (int_ptr $ac_kw ip) { return ip[0]; } | |
14086 | int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ | |
14087 | int bar (int ip[$ac_kw]) { return ip[0]; } | |
14088 | ||
14089 | int | |
14090 | main () | |
14091 | { | |
14092 | int s[1]; | |
14093 | int *$ac_kw t = s; | |
14094 | t[0] = 0; | |
14095 | return foo (t) + bar (t); | |
14096 | ||
14097 | ; | |
14098 | return 0; | |
14099 | } | |
14100 | _ACEOF | |
14101 | if ac_fn_c_try_compile "$LINENO"; then : | |
14102 | ac_cv_c_restrict=$ac_kw | |
14103 | fi | |
14104 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
14105 | test "$ac_cv_c_restrict" != no && break | |
14106 | done | |
14107 | ||
14108 | fi | |
14109 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 | |
14110 | $as_echo "$ac_cv_c_restrict" >&6; } | |
14111 | ||
14112 | case $ac_cv_c_restrict in | |
14113 | restrict) ;; | |
14114 | no) $as_echo "#define restrict /**/" >>confdefs.h | |
14115 | ;; | |
14116 | *) cat >>confdefs.h <<_ACEOF | |
14117 | #define restrict $ac_cv_c_restrict | |
14118 | _ACEOF | |
14119 | ;; | |
14120 | esac | |
13971 | 14121 | |
13972 | 14122 | |
13973 | 14123 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 |
14453 | 14603 | |
14454 | 14604 | |
14455 | 14605 | |
14456 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 | |
14457 | $as_echo_n "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } | |
14606 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5 | |
14607 | $as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; } | |
14458 | 14608 | if ${gl_cv_header_limits_width+:} false; then : |
14459 | 14609 | $as_echo_n "(cached) " >&6 |
14460 | 14610 | else |
14461 | 14611 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
14462 | 14612 | /* end confdefs.h. */ |
14463 | 14613 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ |
14464 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
14465 | #endif | |
14466 | #include <limits.h> | |
14467 | int ullw = ULLONG_WIDTH; | |
14614 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
14615 | #endif | |
14616 | #include <limits.h> | |
14617 | long long llm = LLONG_MAX; | |
14618 | int wb = WORD_BIT; | |
14619 | int ullw = ULLONG_WIDTH; | |
14620 | ||
14468 | 14621 | int |
14469 | 14622 | main () |
14470 | 14623 | { |
14760 | 14913 | |
14761 | 14914 | |
14762 | 14915 | |
14763 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 | |
14764 | $as_echo_n "checking for unsigned long long int... " >&6; } | |
14765 | if ${ac_cv_type_unsigned_long_long_int+:} false; then : | |
14766 | $as_echo_n "(cached) " >&6 | |
14767 | else | |
14768 | ac_cv_type_unsigned_long_long_int=yes | |
14769 | if test "x${ac_cv_prog_cc_c99-no}" = xno; then | |
14770 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14771 | /* end confdefs.h. */ | |
14772 | ||
14773 | /* For now, do not test the preprocessor; as of 2007 there are too many | |
14774 | implementations with broken preprocessors. Perhaps this can | |
14775 | be revisited in 2012. In the meantime, code should not expect | |
14776 | #if to work with literals wider than 32 bits. */ | |
14777 | /* Test literals. */ | |
14778 | long long int ll = 9223372036854775807ll; | |
14779 | long long int nll = -9223372036854775807LL; | |
14780 | unsigned long long int ull = 18446744073709551615ULL; | |
14781 | /* Test constant expressions. */ | |
14782 | typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) | |
14783 | ? 1 : -1)]; | |
14784 | typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 | |
14785 | ? 1 : -1)]; | |
14786 | int i = 63; | |
14787 | int | |
14788 | main () | |
14789 | { | |
14790 | /* Test availability of runtime routines for shift and division. */ | |
14791 | long long int llmax = 9223372036854775807ll; | |
14792 | unsigned long long int ullmax = 18446744073709551615ull; | |
14793 | return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | |
14794 | | (llmax / ll) | (llmax % ll) | |
14795 | | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | |
14796 | | (ullmax / ull) | (ullmax % ull)); | |
14797 | ; | |
14798 | return 0; | |
14799 | } | |
14800 | ||
14801 | _ACEOF | |
14802 | if ac_fn_c_try_link "$LINENO"; then : | |
14803 | ||
14804 | else | |
14805 | ac_cv_type_unsigned_long_long_int=no | |
14806 | fi | |
14807 | rm -f core conftest.err conftest.$ac_objext \ | |
14808 | conftest$ac_exeext conftest.$ac_ext | |
14809 | fi | |
14810 | fi | |
14811 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 | |
14812 | $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } | |
14813 | if test $ac_cv_type_unsigned_long_long_int = yes; then | |
14916 | ||
14917 | ||
14918 | ||
14919 | ||
14920 | ||
14921 | ||
14922 | ||
14923 | ||
14924 | ||
14925 | $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h | |
14926 | ||
14814 | 14927 | |
14815 | 14928 | $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h |
14816 | ||
14817 | fi | |
14818 | ||
14819 | ||
14820 | ||
14821 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 | |
14822 | $as_echo_n "checking for long long int... " >&6; } | |
14823 | if ${ac_cv_type_long_long_int+:} false; then : | |
14824 | $as_echo_n "(cached) " >&6 | |
14825 | else | |
14826 | ac_cv_type_long_long_int=yes | |
14827 | if test "x${ac_cv_prog_cc_c99-no}" = xno; then | |
14828 | ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int | |
14829 | if test $ac_cv_type_long_long_int = yes; then | |
14830 | if test "$cross_compiling" = yes; then : | |
14831 | : | |
14832 | else | |
14833 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14834 | /* end confdefs.h. */ | |
14835 | #include <limits.h> | |
14836 | #ifndef LLONG_MAX | |
14837 | # define HALF \ | |
14838 | (1LL << (sizeof (long long int) * CHAR_BIT - 2)) | |
14839 | # define LLONG_MAX (HALF - 1 + HALF) | |
14840 | #endif | |
14841 | int | |
14842 | main () | |
14843 | { | |
14844 | long long int n = 1; | |
14845 | int i; | |
14846 | for (i = 0; ; i++) | |
14847 | { | |
14848 | long long int m = n << i; | |
14849 | if (m >> i != n) | |
14850 | return 1; | |
14851 | if (LLONG_MAX / 2 < m) | |
14852 | break; | |
14853 | } | |
14854 | return 0; | |
14855 | ; | |
14856 | return 0; | |
14857 | } | |
14858 | _ACEOF | |
14859 | if ac_fn_c_try_run "$LINENO"; then : | |
14860 | ||
14861 | else | |
14862 | ac_cv_type_long_long_int=no | |
14863 | fi | |
14864 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
14865 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
14866 | fi | |
14867 | ||
14868 | fi | |
14869 | fi | |
14870 | fi | |
14871 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 | |
14872 | $as_echo "$ac_cv_type_long_long_int" >&6; } | |
14873 | if test $ac_cv_type_long_long_int = yes; then | |
14874 | ||
14875 | $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h | |
14876 | ||
14877 | fi | |
14878 | ||
14879 | ||
14880 | ||
14881 | ||
14882 | ||
14883 | ||
14884 | ||
14885 | ||
14886 | ||
14887 | ||
14888 | ||
14889 | if test $ac_cv_type_long_long_int = yes; then | |
14890 | HAVE_LONG_LONG_INT=1 | |
14891 | else | |
14892 | HAVE_LONG_LONG_INT=0 | |
14893 | fi | |
14894 | ||
14895 | ||
14896 | if test $ac_cv_type_unsigned_long_long_int = yes; then | |
14897 | HAVE_UNSIGNED_LONG_LONG_INT=1 | |
14898 | else | |
14899 | HAVE_UNSIGNED_LONG_LONG_INT=0 | |
14900 | fi | |
14901 | 14929 | |
14902 | 14930 | |
14903 | 14931 | |
15744 | 15772 | GL_GENERATE_STDINT_H_FALSE= |
15745 | 15773 | fi |
15746 | 15774 | |
15747 | ||
15748 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 | |
15749 | $as_echo_n "checking for C/C++ restrict keyword... " >&6; } | |
15750 | if ${ac_cv_c_restrict+:} false; then : | |
15751 | $as_echo_n "(cached) " >&6 | |
15752 | else | |
15753 | ac_cv_c_restrict=no | |
15754 | # The order here caters to the fact that C++ does not require restrict. | |
15755 | for ac_kw in __restrict __restrict__ _Restrict restrict; do | |
15756 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15757 | /* end confdefs.h. */ | |
15758 | typedef int *int_ptr; | |
15759 | int foo (int_ptr $ac_kw ip) { return ip[0]; } | |
15760 | int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ | |
15761 | int bar (int ip[$ac_kw]) { return ip[0]; } | |
15762 | ||
15763 | int | |
15764 | main () | |
15765 | { | |
15766 | int s[1]; | |
15767 | int *$ac_kw t = s; | |
15768 | t[0] = 0; | |
15769 | return foo (t) + bar (t); | |
15770 | ||
15771 | ; | |
15772 | return 0; | |
15773 | } | |
15774 | _ACEOF | |
15775 | if ac_fn_c_try_compile "$LINENO"; then : | |
15776 | ac_cv_c_restrict=$ac_kw | |
15777 | fi | |
15778 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15779 | test "$ac_cv_c_restrict" != no && break | |
15780 | done | |
15781 | ||
15782 | fi | |
15783 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 | |
15784 | $as_echo "$ac_cv_c_restrict" >&6; } | |
15785 | ||
15786 | case $ac_cv_c_restrict in | |
15787 | restrict) ;; | |
15788 | no) $as_echo "#define restrict /**/" >>confdefs.h | |
15789 | ;; | |
15790 | *) cat >>confdefs.h <<_ACEOF | |
15791 | #define restrict $ac_cv_c_restrict | |
15792 | _ACEOF | |
15793 | ;; | |
15794 | esac | |
15795 | 15775 | |
15796 | 15776 | |
15797 | 15777 | GNULIB_EXPLICIT_BZERO=0; |
15880 | 15860 | |
15881 | 15861 | |
15882 | 15862 | |
15883 | ||
15884 | 15863 | if test $gl_cv_have_include_next = yes; then |
15885 | 15864 | gl_cv_next_string_h='<'string.h'>' |
15886 | 15865 | else |
15951 | 15930 | |
15952 | 15931 | |
15953 | 15932 | |
15933 | ||
15934 | ||
15954 | 15935 | ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" |
15955 | 15936 | if test "x$ac_cv_type_pid_t" = xyes; then : |
15956 | 15937 | |
16069 | 16050 | |
16070 | 16051 | |
16071 | 16052 | |
16053 | GNULIB_ACCESS=0; | |
16072 | 16054 | GNULIB_CHDIR=0; |
16073 | 16055 | GNULIB_CHOWN=0; |
16074 | 16056 | GNULIB_CLOSE=0; |
16057 | GNULIB_COPY_FILE_RANGE=0; | |
16075 | 16058 | GNULIB_DUP=0; |
16076 | 16059 | GNULIB_DUP2=0; |
16077 | 16060 | GNULIB_DUP3=0; |
16090 | 16073 | GNULIB_GETHOSTNAME=0; |
16091 | 16074 | GNULIB_GETLOGIN=0; |
16092 | 16075 | GNULIB_GETLOGIN_R=0; |
16076 | GNULIB_GETOPT_POSIX=0; | |
16093 | 16077 | GNULIB_GETPAGESIZE=0; |
16094 | 16078 | GNULIB_GETPASS=0; |
16095 | 16079 | GNULIB_GETUSERSHELL=0; |
16120 | 16104 | GNULIB_USLEEP=0; |
16121 | 16105 | GNULIB_WRITE=0; |
16122 | 16106 | HAVE_CHOWN=1; |
16107 | HAVE_COPY_FILE_RANGE=1; | |
16123 | 16108 | HAVE_DUP2=1; |
16124 | 16109 | HAVE_DUP3=1; |
16125 | 16110 | HAVE_EUIDACCESS=1; |
16164 | 16149 | HAVE_DECL_TTYNAME_R=1; |
16165 | 16150 | HAVE_OS_H=0; |
16166 | 16151 | HAVE_SYS_PARAM_H=0; |
16152 | REPLACE_ACCESS=0; | |
16167 | 16153 | REPLACE_CHOWN=0; |
16168 | 16154 | REPLACE_CLOSE=0; |
16169 | 16155 | REPLACE_DUP=0; |
16304 | 16290 | gl_next_as_first_directive=$gl_cv_next_inttypes_h |
16305 | 16291 | fi |
16306 | 16292 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive |
16293 | ||
16294 | ||
16307 | 16295 | |
16308 | 16296 | |
16309 | 16297 | |
16469 | 16457 | REPLACE_WCWIDTH=0; |
16470 | 16458 | REPLACE_WCSWIDTH=0; |
16471 | 16459 | REPLACE_WCSFTIME=0; |
16460 | REPLACE_WCSTOK=0; | |
16472 | 16461 | |
16473 | 16462 | |
16474 | 16463 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 |
16590 | 16579 | |
16591 | 16580 | |
16592 | 16581 | |
16582 | ||
16593 | 16583 | gl_source_base='gl' |
16594 | 16584 | |
16595 | 16585 | for ac_header in byteswap.h |
16618 | 16608 | GL_GENERATE_BYTESWAP_H_TRUE='#' |
16619 | 16609 | GL_GENERATE_BYTESWAP_H_FALSE= |
16620 | 16610 | fi |
16611 | ||
16621 | 16612 | |
16622 | 16613 | |
16623 | 16614 | |
16672 | 16663 | $as_echo "#define HAVE_INLINE 1" >>confdefs.h |
16673 | 16664 | |
16674 | 16665 | fi |
16666 | ||
16667 | ||
16668 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5 | |
16669 | $as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; } | |
16670 | if ${gl_cv_c___inline+:} false; then : | |
16671 | $as_echo_n "(cached) " >&6 | |
16672 | else | |
16673 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16674 | /* end confdefs.h. */ | |
16675 | typedef int foo_t; | |
16676 | static __inline foo_t foo (void) { return 0; } | |
16677 | int | |
16678 | main () | |
16679 | { | |
16680 | return foo (); | |
16681 | ; | |
16682 | return 0; | |
16683 | } | |
16684 | _ACEOF | |
16685 | if ac_fn_c_try_compile "$LINENO"; then : | |
16686 | gl_cv_c___inline=yes | |
16687 | else | |
16688 | gl_cv_c___inline=no | |
16689 | fi | |
16690 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16691 | fi | |
16692 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5 | |
16693 | $as_echo "$gl_cv_c___inline" >&6; } | |
16694 | if test $gl_cv_c___inline = yes; then | |
16695 | ||
16696 | $as_echo "#define HAVE___INLINE 1" >>confdefs.h | |
16697 | ||
16698 | fi | |
16699 | ||
16675 | 16700 | |
16676 | 16701 | |
16677 | 16702 | |
16785 | 16810 | |
16786 | 16811 | |
16787 | 16812 | |
16788 | # Define two additional variables used in the Makefile substitution. | |
16789 | ||
16790 | if test "$ac_cv_header_stdbool_h" = yes; then | |
16791 | STDBOOL_H='' | |
16813 | ||
16814 | if test "$ac_cv_header_stdbool_h" = yes; then | |
16815 | case "$host_os" in | |
16816 | solaris*) | |
16817 | if test -z "$GCC"; then | |
16818 | STDBOOL_H='stdbool.h' | |
16819 | else | |
16820 | STDBOOL_H='' | |
16821 | fi | |
16822 | ;; | |
16823 | *) | |
16824 | STDBOOL_H='' | |
16825 | ;; | |
16826 | esac | |
16792 | 16827 | else |
16793 | 16828 | STDBOOL_H='stdbool.h' |
16794 | 16829 | fi |
16813 | 16848 | |
16814 | 16849 | |
16815 | 16850 | STDDEF_H= |
16816 | ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> | |
16817 | ||
16818 | " | |
16819 | if test "x$ac_cv_type_max_align_t" = xyes; then : | |
16820 | ||
16821 | else | |
16822 | HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h | |
16823 | fi | |
16851 | ||
16852 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 | |
16853 | $as_echo_n "checking for good max_align_t... " >&6; } | |
16854 | if ${gl_cv_type_max_align_t+:} false; then : | |
16855 | $as_echo_n "(cached) " >&6 | |
16856 | else | |
16857 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16858 | /* end confdefs.h. */ | |
16859 | #include <stddef.h> | |
16860 | unsigned int s = sizeof (max_align_t); | |
16861 | #if defined __GNUC__ || defined __IBM__ALIGNOF__ | |
16862 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; | |
16863 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
16864 | #endif | |
16865 | ||
16866 | int | |
16867 | main () | |
16868 | { | |
16869 | ||
16870 | ; | |
16871 | return 0; | |
16872 | } | |
16873 | _ACEOF | |
16874 | if ac_fn_c_try_compile "$LINENO"; then : | |
16875 | gl_cv_type_max_align_t=yes | |
16876 | else | |
16877 | gl_cv_type_max_align_t=no | |
16878 | fi | |
16879 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16880 | ||
16881 | fi | |
16882 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 | |
16883 | $as_echo "$gl_cv_type_max_align_t" >&6; } | |
16884 | if test $gl_cv_type_max_align_t = no; then | |
16885 | HAVE_MAX_ALIGN_T=0 | |
16886 | STDDEF_H=stddef.h | |
16887 | fi | |
16824 | 16888 | |
16825 | 16889 | if test $gt_cv_c_wchar_t = no; then |
16826 | 16890 | HAVE_WCHAR_T=0 |
16827 | 16891 | STDDEF_H=stddef.h |
16828 | 16892 | fi |
16893 | ||
16829 | 16894 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 |
16830 | 16895 | $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } |
16831 | 16896 | if ${gl_cv_decl_null_works+:} false; then : |
16857 | 16922 | REPLACE_NULL=1 |
16858 | 16923 | STDDEF_H=stddef.h |
16859 | 16924 | fi |
16925 | ||
16860 | 16926 | |
16861 | 16927 | if test -n "$STDDEF_H"; then |
16862 | 16928 | GL_GENERATE_STDDEF_H_TRUE= |
17092 | 17158 | |
17093 | 17159 | |
17094 | 17160 | |
17161 | ||
17162 | ||
17095 | 17163 | # Check whether --enable-valgrind-tests was given. |
17096 | 17164 | if test "${enable_valgrind_tests+set}" = set; then : |
17097 | 17165 | enableval=$enable_valgrind_tests; opt_valgrind_tests=$enableval |
17178 | 17246 | |
17179 | 17247 | gltests_libdeps= |
17180 | 17248 | gltests_ltlibdeps= |
17249 | ||
17181 | 17250 | |
17182 | 17251 | |
17183 | 17252 | |
17251 | 17320 | |
17252 | 17321 | #if defined INT32_MAX && defined INTMAX_MAX |
17253 | 17322 | #define CONDITION (INT32_MAX < INTMAX_MAX) |
17254 | #elif HAVE_LONG_LONG_INT | |
17323 | #else | |
17255 | 17324 | #define CONDITION (sizeof (int) < sizeof (long long int)) |
17256 | #else | |
17257 | #define CONDITION 0 | |
17258 | 17325 | #endif |
17259 | 17326 | int test[CONDITION ? 1 : -1]; |
17260 | 17327 | int |
17303 | 17370 | |
17304 | 17371 | #if defined INT64_MAX |
17305 | 17372 | #define CONDITION (INT64_MAX == LONG_MAX) |
17306 | #elif HAVE_LONG_LONG_INT | |
17373 | #else | |
17307 | 17374 | #define CONDITION (sizeof (long long int) == sizeof (long int)) |
17308 | #else | |
17309 | #define CONDITION 0 | |
17310 | 17375 | #endif |
17311 | 17376 | int test[CONDITION ? 1 : -1]; |
17312 | 17377 | int |
17357 | 17422 | |
17358 | 17423 | #if defined UINT32_MAX && defined UINTMAX_MAX |
17359 | 17424 | #define CONDITION (UINT32_MAX < UINTMAX_MAX) |
17360 | #elif HAVE_LONG_LONG_INT | |
17425 | #else | |
17361 | 17426 | #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) |
17362 | #else | |
17363 | #define CONDITION 0 | |
17364 | 17427 | #endif |
17365 | 17428 | int test[CONDITION ? 1 : -1]; |
17366 | 17429 | int |
17409 | 17472 | |
17410 | 17473 | #if defined UINT64_MAX |
17411 | 17474 | #define CONDITION (UINT64_MAX == ULONG_MAX) |
17412 | #elif HAVE_LONG_LONG_INT | |
17475 | #else | |
17413 | 17476 | #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) |
17414 | #else | |
17415 | #define CONDITION 0 | |
17416 | 17477 | #endif |
17417 | 17478 | int test[CONDITION ? 1 : -1]; |
17418 | 17479 | int |
17446 | 17507 | |
17447 | 17508 | |
17448 | 17509 | |
17510 | ||
17511 | abs_aux_dir=`cd "$ac_aux_dir"; pwd` | |
17449 | 17512 | |
17450 | 17513 | |
17451 | 17514 | # Check whether --enable-valgrind-tests was given. |
17636 | 17699 | |
17637 | 17700 | |
17638 | 17701 | |
17702 | ||
17703 | ||
17639 | 17704 | LIBTESTS_LIBDEPS="$gltests_libdeps" |
17640 | 17705 | |
17641 | 17706 | |
17664 | 17729 | |
17665 | 17730 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 |
17666 | 17731 | $as_echo_n "checking whether -Wno-missing-field-initializers is supported... " >&6; } |
17667 | if ${gl_cv_cc_nomfi_supported+:} false; then : | |
17732 | if ${gl_cv_cc_nomfi_supported+:} false; then : | |
17668 | 17733 | $as_echo_n "(cached) " >&6 |
17669 | 17734 | else |
17670 | ||
17671 | gl_save_CFLAGS="$CFLAGS" | |
17672 | CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" | |
17673 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17735 | gl_save_CFLAGS="$CFLAGS" | |
17736 | CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" | |
17737 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17674 | 17738 | /* end confdefs.h. */ |
17675 | 17739 | |
17676 | 17740 | int |
17687 | 17751 | gl_cv_cc_nomfi_supported=no |
17688 | 17752 | fi |
17689 | 17753 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
17690 | CFLAGS="$gl_save_CFLAGS" | |
17691 | fi | |
17692 | ||
17693 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 | |
17754 | CFLAGS="$gl_save_CFLAGS" | |
17755 | ||
17756 | fi | |
17757 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 | |
17694 | 17758 | $as_echo "$gl_cv_cc_nomfi_supported" >&6; } |
17695 | 17759 | |
17696 | 17760 | if test "$gl_cv_cc_nomfi_supported" = yes; then |
17697 | 17761 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 |
17698 | 17762 | $as_echo_n "checking whether -Wno-missing-field-initializers is needed... " >&6; } |
17699 | if ${gl_cv_cc_nomfi_needed+:} false; then : | |
17763 | if ${gl_cv_cc_nomfi_needed+:} false; then : | |
17700 | 17764 | $as_echo_n "(cached) " >&6 |
17701 | 17765 | else |
17702 | ||
17703 | gl_save_CFLAGS="$CFLAGS" | |
17704 | CFLAGS="$CFLAGS -W -Werror" | |
17705 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17766 | gl_save_CFLAGS="$CFLAGS" | |
17767 | CFLAGS="$CFLAGS -W -Werror" | |
17768 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17706 | 17769 | /* end confdefs.h. */ |
17707 | 17770 | int f (void) |
17708 | { | |
17709 | typedef struct { int a; int b; } s_t; | |
17710 | s_t s1 = { 0, }; | |
17711 | return s1.b; | |
17712 | } | |
17771 | { | |
17772 | typedef struct { int a; int b; } s_t; | |
17773 | s_t s1 = { 0, }; | |
17774 | return s1.b; | |
17775 | } | |
17713 | 17776 | |
17714 | 17777 | int |
17715 | 17778 | main () |
17725 | 17788 | gl_cv_cc_nomfi_needed=yes |
17726 | 17789 | fi |
17727 | 17790 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
17728 | CFLAGS="$gl_save_CFLAGS" | |
17729 | ||
17730 | fi | |
17731 | ||
17732 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 | |
17791 | CFLAGS="$gl_save_CFLAGS" | |
17792 | ||
17793 | fi | |
17794 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 | |
17733 | 17795 | $as_echo "$gl_cv_cc_nomfi_needed" >&6; } |
17734 | 17796 | fi |
17735 | 17797 | |
17736 | 17798 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 |
17737 | 17799 | $as_echo_n "checking whether -Wuninitialized is supported... " >&6; } |
17738 | if ${gl_cv_cc_uninitialized_supported+:} false; then : | |
17800 | if ${gl_cv_cc_uninitialized_supported+:} false; then : | |
17739 | 17801 | $as_echo_n "(cached) " >&6 |
17740 | 17802 | else |
17741 | ||
17742 | gl_save_CFLAGS="$CFLAGS" | |
17743 | CFLAGS="$CFLAGS -Werror -Wuninitialized" | |
17744 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17803 | gl_save_CFLAGS="$CFLAGS" | |
17804 | CFLAGS="$CFLAGS -Werror -Wuninitialized" | |
17805 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17745 | 17806 | /* end confdefs.h. */ |
17746 | 17807 | |
17747 | 17808 | int |
17758 | 17819 | gl_cv_cc_uninitialized_supported=no |
17759 | 17820 | fi |
17760 | 17821 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
17761 | CFLAGS="$gl_save_CFLAGS" | |
17762 | fi | |
17763 | ||
17764 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 | |
17822 | CFLAGS="$gl_save_CFLAGS" | |
17823 | ||
17824 | fi | |
17825 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 | |
17765 | 17826 | $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } |
17766 | 17827 | |
17767 | 17828 | fi |
17777 | 17838 | gl_manywarn_set= |
17778 | 17839 | for gl_manywarn_item in -fno-common \ |
17779 | 17840 | -W \ |
17841 | -Wabsolute-value \ | |
17780 | 17842 | -Waddress \ |
17843 | -Waddress-of-packed-member \ | |
17781 | 17844 | -Waggressive-loop-optimizations \ |
17782 | 17845 | -Wall \ |
17783 | -Wattribute-alias \ | |
17846 | -Wattribute-warning \ | |
17784 | 17847 | -Wattributes \ |
17785 | 17848 | -Wbad-function-cast \ |
17786 | 17849 | -Wbool-compare \ |
17787 | 17850 | -Wbool-operation \ |
17788 | 17851 | -Wbuiltin-declaration-mismatch \ |
17789 | 17852 | -Wbuiltin-macro-redefined \ |
17853 | -Wcannot-profile \ | |
17790 | 17854 | -Wcast-align \ |
17791 | 17855 | -Wcast-align=strict \ |
17792 | 17856 | -Wcast-function-type \ |
17851 | 17915 | -Wmissing-field-initializers \ |
17852 | 17916 | -Wmissing-include-dirs \ |
17853 | 17917 | -Wmissing-parameter-type \ |
17918 | -Wmissing-profile \ | |
17854 | 17919 | -Wmissing-prototypes \ |
17855 | 17920 | -Wmultichar \ |
17856 | 17921 | -Wmultistatement-macros \ |
17961 | 18026 | $as_echo "$gl_alloc_max" >&6; } |
17962 | 18027 | gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max" |
17963 | 18028 | gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" |
18029 | gl_manywarn_set="$gl_manywarn_set -Wattribute-alias=2" | |
17964 | 18030 | gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" |
17965 | 18031 | gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" |
17966 | 18032 | gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" |
18790 | 18856 | # report actual input values of CONFIG_FILES etc. instead of their |
18791 | 18857 | # values after options handling. |
18792 | 18858 | ac_log=" |
18793 | This file was extended by libntlm $as_me 1.5, which was | |
18859 | This file was extended by libntlm $as_me 1.6, which was | |
18794 | 18860 | generated by GNU Autoconf 2.69. Invocation command line was |
18795 | 18861 | |
18796 | 18862 | CONFIG_FILES = $CONFIG_FILES |
18860 | 18926 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
18861 | 18927 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
18862 | 18928 | ac_cs_version="\\ |
18863 | libntlm config.status 1.5 | |
18929 | libntlm config.status 1.6 | |
18864 | 18930 | configured by $0, generated by GNU Autoconf 2.69, |
18865 | 18931 | with options \\"\$ac_cs_config\\" |
18866 | 18932 | |
18979 | 19045 | # |
18980 | 19046 | # INIT-COMMANDS |
18981 | 19047 | # |
18982 | AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" | |
19048 | AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" | |
18983 | 19049 | |
18984 | 19050 | |
18985 | 19051 | # The HP-UX ksh and POSIX shell print the target directory to stdout |
19916 | 19982 | # Older Autoconf quotes --file arguments for eval, but not when files |
19917 | 19983 | # are listed without --file. Let's play safe and only enable the eval |
19918 | 19984 | # if we detect the quoting. |
19919 | case $CONFIG_FILES in | |
19920 | *\'*) eval set x "$CONFIG_FILES" ;; | |
19921 | *) set x $CONFIG_FILES ;; | |
19922 | esac | |
19985 | # TODO: see whether this extra hack can be removed once we start | |
19986 | # requiring Autoconf 2.70 or later. | |
19987 | case $CONFIG_FILES in #( | |
19988 | *\'*) : | |
19989 | eval set x "$CONFIG_FILES" ;; #( | |
19990 | *) : | |
19991 | set x $CONFIG_FILES ;; #( | |
19992 | *) : | |
19993 | ;; | |
19994 | esac | |
19923 | 19995 | shift |
19924 | for mf | |
19996 | # Used to flag and report bootstrapping failures. | |
19997 | am_rc=0 | |
19998 | for am_mf | |
19925 | 19999 | do |
19926 | 20000 | # Strip MF so we end up with the name of the file. |
19927 | mf=`echo "$mf" | sed -e 's/:.*$//'` | |
19928 | # Check whether this is an Automake generated Makefile or not. | |
19929 | # We used to match only the files named 'Makefile.in', but | |
19930 | # some people rename them; so instead we look at the file content. | |
19931 | # Grep'ing the first line is not enough: some people post-process | |
19932 | # each Makefile.in and add a new line on top of each file to say so. | |
19933 | # Grep'ing the whole file is not good either: AIX grep has a line | |
20001 | am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` | |
20002 | # Check whether this is an Automake generated Makefile which includes | |
20003 | # dependency-tracking related rules and includes. | |
20004 | # Grep'ing the whole file directly is not great: AIX grep has a line | |
19934 | 20005 | # limit of 2048, but all sed's we know have understand at least 4000. |
19935 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then | |
19936 | dirpart=`$as_dirname -- "$mf" || | |
19937 | $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
19938 | X"$mf" : 'X\(//\)[^/]' \| \ | |
19939 | X"$mf" : 'X\(//\)$' \| \ | |
19940 | X"$mf" : 'X\(/\)' \| . 2>/dev/null || | |
19941 | $as_echo X"$mf" | | |
20006 | sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ | |
20007 | || continue | |
20008 | am_dirpart=`$as_dirname -- "$am_mf" || | |
20009 | $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
20010 | X"$am_mf" : 'X\(//\)[^/]' \| \ | |
20011 | X"$am_mf" : 'X\(//\)$' \| \ | |
20012 | X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || | |
20013 | $as_echo X"$am_mf" | | |
19942 | 20014 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ |
19943 | 20015 | s//\1/ |
19944 | 20016 | q |
19956 | 20028 | q |
19957 | 20029 | } |
19958 | 20030 | s/.*/./; q'` |
19959 | else | |
19960 | continue | |
19961 | fi | |
19962 | # Extract the definition of DEPDIR, am__include, and am__quote | |
19963 | # from the Makefile without running 'make'. | |
19964 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` | |
19965 | test -z "$DEPDIR" && continue | |
19966 | am__include=`sed -n 's/^am__include = //p' < "$mf"` | |
19967 | test -z "$am__include" && continue | |
19968 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` | |
19969 | # Find all dependency output files, they are included files with | |
19970 | # $(DEPDIR) in their names. We invoke sed twice because it is the | |
19971 | # simplest approach to changing $(DEPDIR) to its actual value in the | |
19972 | # expansion. | |
19973 | for file in `sed -n " | |
19974 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ | |
19975 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do | |
19976 | # Make sure the directory exists. | |
19977 | test -f "$dirpart/$file" && continue | |
19978 | fdir=`$as_dirname -- "$file" || | |
19979 | $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
19980 | X"$file" : 'X\(//\)[^/]' \| \ | |
19981 | X"$file" : 'X\(//\)$' \| \ | |
19982 | X"$file" : 'X\(/\)' \| . 2>/dev/null || | |
19983 | $as_echo X"$file" | | |
19984 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
20031 | am_filepart=`$as_basename -- "$am_mf" || | |
20032 | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ | |
20033 | X"$am_mf" : 'X\(//\)$' \| \ | |
20034 | X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || | |
20035 | $as_echo X/"$am_mf" | | |
20036 | sed '/^.*\/\([^/][^/]*\)\/*$/{ | |
19985 | 20037 | s//\1/ |
19986 | 20038 | q |
19987 | 20039 | } |
19988 | /^X\(\/\/\)[^/].*/{ | |
20040 | /^X\/\(\/\/\)$/{ | |
19989 | 20041 | s//\1/ |
19990 | 20042 | q |
19991 | 20043 | } |
19992 | /^X\(\/\/\)$/{ | |
19993 | s//\1/ | |
19994 | q | |
19995 | } | |
19996 | /^X\(\/\).*/{ | |
20044 | /^X\/\(\/\).*/{ | |
19997 | 20045 | s//\1/ |
19998 | 20046 | q |
19999 | 20047 | } |
20000 | 20048 | s/.*/./; q'` |
20001 | as_dir=$dirpart/$fdir; as_fn_mkdir_p | |
20002 | # echo "creating $dirpart/$file" | |
20003 | echo '# dummy' > "$dirpart/$file" | |
20004 | done | |
20049 | { echo "$as_me:$LINENO: cd "$am_dirpart" \ | |
20050 | && sed -e '/# am--include-marker/d' "$am_filepart" \ | |
20051 | | $MAKE -f - am--depfiles" >&5 | |
20052 | (cd "$am_dirpart" \ | |
20053 | && sed -e '/# am--include-marker/d' "$am_filepart" \ | |
20054 | | $MAKE -f - am--depfiles) >&5 2>&5 | |
20055 | ac_status=$? | |
20056 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
20057 | (exit $ac_status); } || am_rc=$? | |
20005 | 20058 | done |
20059 | if test $am_rc -ne 0; then | |
20060 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
20061 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
20062 | as_fn_error $? "Something went wrong bootstrapping makefile fragments | |
20063 | for automatic dependency tracking. Try re-running configure with the | |
20064 | '--disable-dependency-tracking' option to at least be able to build | |
20065 | the package (albeit without support for automatic dependency tracking). | |
20066 | See \`config.log' for more details" "$LINENO" 5; } | |
20067 | fi | |
20068 | { am_dirpart=; unset am_dirpart;} | |
20069 | { am_filepart=; unset am_filepart;} | |
20070 | { am_mf=; unset am_mf;} | |
20071 | { am_rc=; unset am_rc;} | |
20072 | rm -f conftest-deps.mk | |
20006 | 20073 | } |
20007 | 20074 | ;; |
20008 | 20075 | "libtool":C) |
0 | 0 | dnl Process this file with autoconf to produce a configure script. |
1 | 1 | |
2 | dnl Copyright (C) 2002-2018 Simon Josefsson. | |
2 | dnl Copyright (C) 2002-2020 Simon Josefsson. | |
3 | 3 | dnl |
4 | 4 | dnl This file is part of Libntlm. |
5 | 5 | dnl |
18 | 18 | dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
19 | 19 | dnl 02110-1301, USA |
20 | 20 | |
21 | AC_PREREQ(2.61) | |
22 | AC_INIT([libntlm], [1.5], [libntlm@nongnu.org]) | |
21 | AC_PREREQ(2.63) | |
22 | AC_INIT([libntlm], [1.6], [libntlm@nongnu.org]) | |
23 | 23 | AC_CONFIG_AUX_DIR([build-aux]) |
24 | 24 | AC_CONFIG_MACRO_DIR([m4]) |
25 | 25 | |
28 | 28 | # No interfaces changed: REVISION++ |
29 | 29 | AC_SUBST(LT_CURRENT, 0) |
30 | 30 | AC_SUBST(LT_AGE, 0) |
31 | AC_SUBST(LT_REVISION, 20) | |
31 | AC_SUBST(LT_REVISION, 21) | |
32 | 32 | |
33 | 33 | AM_INIT_AUTOMAKE([1.10 gnits -Wall -Werror]) |
34 | 34 | AM_CONFIG_HEADER(config.h) |
0 | 0 | ## DO NOT EDIT! GENERATED AUTOMATICALLY! |
1 | 1 | ## Process this file with automake to produce Makefile.in. |
2 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
3 | 3 | # |
4 | 4 | # This file is free software; you can redistribute it and/or modify |
5 | 5 | # it under the terms of the GNU General Public License as published by |
44 | 44 | # manywarnings \ |
45 | 45 | # strverscmp \ |
46 | 46 | # unistd \ |
47 | # update-copyright \ | |
47 | 48 | # valgrind-tests \ |
48 | 49 | # warnings |
49 | 50 | |
50 | AUTOMAKE_OPTIONS = 1.9.6 gnits | |
51 | AUTOMAKE_OPTIONS = 1.11 gnits | |
51 | 52 | |
52 | 53 | SUBDIRS = |
53 | 54 | noinst_HEADERS = |
62 | 63 | DISTCLEANFILES = |
63 | 64 | MAINTAINERCLEANFILES = |
64 | 65 | # No GNU Make output. |
65 | SUBDIRS += tests | |
66 | SUBDIRS += . tests | |
66 | 67 | EXTRA_DIST += m4/gnulib-cache.m4 |
67 | 68 | |
68 | 69 | AM_CPPFLAGS = |
141 | 142 | test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile |
142 | 143 | |
143 | 144 | ## end gnulib module gnumakefile |
145 | ||
146 | ## begin gnulib module libc-config | |
147 | ||
148 | ||
149 | EXTRA_DIST += cdefs.h libc-config.h | |
150 | ||
151 | ## end gnulib module libc-config | |
144 | 152 | |
145 | 153 | ## begin gnulib module limits-h |
146 | 154 | |
311 | 319 | -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ |
312 | 320 | -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ |
313 | 321 | -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ |
314 | -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ | |
315 | -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ | |
316 | 322 | -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ |
317 | 323 | -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ |
318 | 324 | -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ |
495 | 501 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ |
496 | 502 | -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ |
497 | 503 | -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ |
504 | -e 's/@''GNULIB_ACCESS''@/$(GNULIB_ACCESS)/g' \ | |
498 | 505 | -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ |
499 | 506 | -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ |
500 | 507 | -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ |
508 | -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GNULIB_COPY_FILE_RANGE)/g' \ | |
501 | 509 | -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ |
502 | 510 | -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ |
503 | 511 | -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ |
516 | 524 | -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ |
517 | 525 | -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ |
518 | 526 | -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ |
527 | -e 's/@''GNULIB_GETOPT_POSIX''@/$(GNULIB_GETOPT_POSIX)/g' \ | |
519 | 528 | -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ |
520 | 529 | -e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \ |
521 | 530 | -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ |
548 | 557 | -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ |
549 | 558 | < $(srcdir)/unistd.in.h | \ |
550 | 559 | sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ |
560 | -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ | |
551 | 561 | -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ |
552 | 562 | -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ |
553 | 563 | -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ |
592 | 602 | -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ |
593 | 603 | -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ |
594 | 604 | | \ |
595 | sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ | |
605 | sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \ | |
606 | -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ | |
596 | 607 | -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ |
597 | 608 | -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ |
598 | 609 | -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ |
639 | 650 | |
640 | 651 | ## end gnulib module unistd |
641 | 652 | |
653 | ## begin gnulib module update-copyright | |
654 | ||
655 | ||
656 | EXTRA_DIST += $(top_srcdir)/build-aux/update-copyright | |
657 | ||
658 | ## end gnulib module update-copyright | |
659 | ||
642 | 660 | ## begin gnulib module useless-if-before-free |
643 | 661 | |
644 | 662 |
0 | # Makefile.in generated by automake 1.15 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2014 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
13 | 13 | |
14 | 14 | @SET_MAKE@ |
15 | 15 | |
16 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
16 | # Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
17 | 17 | # |
18 | 18 | # This file is free software; you can redistribute it and/or modify |
19 | 19 | # it under the terms of the GNU General Public License as published by |
58 | 58 | # manywarnings \ |
59 | 59 | # strverscmp \ |
60 | 60 | # unistd \ |
61 | # update-copyright \ | |
61 | 62 | # valgrind-tests \ |
62 | 63 | # warnings |
63 | 64 | |
140 | 141 | subdir = gl |
141 | 142 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
142 | 143 | am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ |
144 | $(top_srcdir)/gl/m4/__inline.m4 \ | |
143 | 145 | $(top_srcdir)/gl/m4/absolute-header.m4 \ |
144 | 146 | $(top_srcdir)/gl/m4/autobuild.m4 \ |
145 | 147 | $(top_srcdir)/gl/m4/byteswap.m4 \ |
152 | 154 | $(top_srcdir)/gl/m4/inttypes-pri.m4 \ |
153 | 155 | $(top_srcdir)/gl/m4/inttypes.m4 \ |
154 | 156 | $(top_srcdir)/gl/m4/limits-h.m4 \ |
155 | $(top_srcdir)/gl/m4/longlong.m4 \ | |
156 | 157 | $(top_srcdir)/gl/m4/manywarnings.m4 $(top_srcdir)/gl/m4/md4.m4 \ |
157 | 158 | $(top_srcdir)/gl/m4/multiarch.m4 $(top_srcdir)/gl/m4/off_t.m4 \ |
158 | 159 | $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdalign.m4 \ |
165 | 166 | $(top_srcdir)/gl/m4/warn-on-use.m4 \ |
166 | 167 | $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_h.m4 \ |
167 | 168 | $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ |
168 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
169 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
170 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
169 | $(top_srcdir)/gl/m4/zzgnulib.m4 $(top_srcdir)/m4/libtool.m4 \ | |
170 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
171 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
172 | $(top_srcdir)/configure.ac | |
171 | 173 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
172 | 174 | $(ACLOCAL_M4) |
173 | 175 | DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ |
202 | 204 | am__v_at_1 = |
203 | 205 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
204 | 206 | depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp |
205 | am__depfiles_maybe = depfiles | |
207 | am__maybe_remake_depfiles = depfiles | |
208 | am__depfiles_remade = ./$(DEPDIR)/check-version.Plo \ | |
209 | ./$(DEPDIR)/des.Plo ./$(DEPDIR)/md4.Plo \ | |
210 | ./$(DEPDIR)/strverscmp.Plo ./$(DEPDIR)/unistd.Plo | |
206 | 211 | am__mv = mv -f |
207 | 212 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
208 | 213 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
245 | 250 | $(RECURSIVE_CLEAN_TARGETS) \ |
246 | 251 | $(am__extra_recursive_targets) |
247 | 252 | AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ |
248 | distdir | |
253 | distdir distdir-am | |
249 | 254 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) |
250 | 255 | # Read a list of newline-separated strings from the standard input, |
251 | 256 | # and print each of them once, without duplicates. Input order is |
329 | 334 | EGREP = @EGREP@ |
330 | 335 | EXEEXT = @EXEEXT@ |
331 | 336 | FGREP = @FGREP@ |
337 | GNULIB_ACCESS = @GNULIB_ACCESS@ | |
332 | 338 | GNULIB_BTOWC = @GNULIB_BTOWC@ |
333 | 339 | GNULIB_CHDIR = @GNULIB_CHDIR@ |
334 | 340 | GNULIB_CHOWN = @GNULIB_CHOWN@ |
335 | 341 | GNULIB_CLOSE = @GNULIB_CLOSE@ |
342 | GNULIB_COPY_FILE_RANGE = @GNULIB_COPY_FILE_RANGE@ | |
336 | 343 | GNULIB_DUP = @GNULIB_DUP@ |
337 | 344 | GNULIB_DUP2 = @GNULIB_DUP2@ |
338 | 345 | GNULIB_DUP3 = @GNULIB_DUP3@ |
354 | 361 | GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ |
355 | 362 | GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ |
356 | 363 | GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ |
364 | GNULIB_GETOPT_POSIX = @GNULIB_GETOPT_POSIX@ | |
357 | 365 | GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ |
358 | 366 | GNULIB_GETPASS = @GNULIB_GETPASS@ |
359 | 367 | GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ |
466 | 474 | HAVE_BTOWC = @HAVE_BTOWC@ |
467 | 475 | HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ |
468 | 476 | HAVE_CHOWN = @HAVE_CHOWN@ |
477 | HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ | |
469 | 478 | HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ |
470 | 479 | HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ |
471 | 480 | HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ |
517 | 526 | HAVE_LCHOWN = @HAVE_LCHOWN@ |
518 | 527 | HAVE_LINK = @HAVE_LINK@ |
519 | 528 | HAVE_LINKAT = @HAVE_LINKAT@ |
520 | HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ | |
521 | 529 | HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ |
522 | 530 | HAVE_MBRLEN = @HAVE_MBRLEN@ |
523 | 531 | HAVE_MBRTOWC = @HAVE_MBRTOWC@ |
556 | 564 | HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ |
557 | 565 | HAVE_UNISTD_H = @HAVE_UNISTD_H@ |
558 | 566 | HAVE_UNLINKAT = @HAVE_UNLINKAT@ |
559 | HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ | |
560 | 567 | HAVE_USLEEP = @HAVE_USLEEP@ |
561 | 568 | HAVE_WCHAR_H = @HAVE_WCHAR_H@ |
562 | 569 | HAVE_WCHAR_T = @HAVE_WCHAR_T@ |
656 | 663 | PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ |
657 | 664 | PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ |
658 | 665 | RANLIB = @RANLIB@ |
666 | REPLACE_ACCESS = @REPLACE_ACCESS@ | |
659 | 667 | REPLACE_BTOWC = @REPLACE_BTOWC@ |
660 | 668 | REPLACE_CHOWN = @REPLACE_CHOWN@ |
661 | 669 | REPLACE_CLOSE = @REPLACE_CLOSE@ |
717 | 725 | REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ |
718 | 726 | REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ |
719 | 727 | REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ |
728 | REPLACE_WCSTOK = @REPLACE_WCSTOK@ | |
720 | 729 | REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ |
721 | 730 | REPLACE_WCTOB = @REPLACE_WCTOB@ |
722 | 731 | REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ |
802 | 811 | top_build_prefix = @top_build_prefix@ |
803 | 812 | top_builddir = @top_builddir@ |
804 | 813 | top_srcdir = @top_srcdir@ |
805 | AUTOMAKE_OPTIONS = 1.9.6 gnits | |
814 | AUTOMAKE_OPTIONS = 1.11 gnits | |
806 | 815 | # No GNU Make output. |
807 | SUBDIRS = tests | |
816 | SUBDIRS = . tests | |
808 | 817 | noinst_HEADERS = |
809 | 818 | noinst_LIBRARIES = |
810 | 819 | noinst_LTLIBRARIES = libgnu.la |
811 | 820 | EXTRA_DIST = m4/gnulib-cache.m4 byteswap.in.h check-version.h des.h \ |
812 | md4.h $(top_srcdir)/GNUmakefile limits.in.h \ | |
813 | $(top_srcdir)/maint.mk arg-nonnull.h c++defs.h warn-on-use.h \ | |
814 | stdalign.in.h stdbool.in.h stddef.in.h stdint.in.h string.in.h \ | |
815 | strverscmp.c sys_types.in.h unistd.in.h \ | |
821 | md4.h $(top_srcdir)/GNUmakefile cdefs.h libc-config.h \ | |
822 | limits.in.h $(top_srcdir)/maint.mk arg-nonnull.h c++defs.h \ | |
823 | warn-on-use.h stdalign.in.h stdbool.in.h stddef.in.h \ | |
824 | stdint.in.h string.in.h strverscmp.c sys_types.in.h \ | |
825 | unistd.in.h $(top_srcdir)/build-aux/update-copyright \ | |
816 | 826 | $(top_srcdir)/build-aux/useless-if-before-free \ |
817 | 827 | $(top_srcdir)/build-aux/vc-list-files |
818 | 828 | BUILT_SOURCES = $(BYTESWAP_H) $(LIMITS_H) $(STDALIGN_H) $(STDBOOL_H) \ |
875 | 885 | *config.status*) \ |
876 | 886 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ |
877 | 887 | *) \ |
878 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | |
879 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | |
888 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ | |
889 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ | |
880 | 890 | esac; |
881 | 891 | |
882 | 892 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) |
911 | 921 | distclean-compile: |
912 | 922 | -rm -f *.tab.c |
913 | 923 | |
914 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-version.Plo@am__quote@ | |
915 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/des.Plo@am__quote@ | |
916 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md4.Plo@am__quote@ | |
917 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Plo@am__quote@ | |
918 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Plo@am__quote@ | |
924 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-version.Plo@am__quote@ # am--include-marker | |
925 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/des.Plo@am__quote@ # am--include-marker | |
926 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md4.Plo@am__quote@ # am--include-marker | |
927 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Plo@am__quote@ # am--include-marker | |
928 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Plo@am__quote@ # am--include-marker | |
929 | ||
930 | $(am__depfiles_remade): | |
931 | @$(MKDIR_P) $(@D) | |
932 | @echo '# dummy' >$@-t && $(am__mv) $@-t $@ | |
933 | ||
934 | am--depfiles: $(am__depfiles_remade) | |
919 | 935 | |
920 | 936 | .c.o: |
921 | 937 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |
1043 | 1059 | distclean-tags: |
1044 | 1060 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
1045 | 1061 | |
1046 | distdir: $(DISTFILES) | |
1062 | distdir: $(BUILT_SOURCES) | |
1063 | $(MAKE) $(AM_MAKEFLAGS) distdir-am | |
1064 | ||
1065 | distdir-am: $(DISTFILES) | |
1047 | 1066 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ |
1048 | 1067 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ |
1049 | 1068 | list='$(DISTFILES)'; \ |
1146 | 1165 | clean-noinstLTLIBRARIES mostlyclean-am |
1147 | 1166 | |
1148 | 1167 | distclean: distclean-recursive |
1149 | -rm -rf ./$(DEPDIR) | |
1168 | -rm -f ./$(DEPDIR)/check-version.Plo | |
1169 | -rm -f ./$(DEPDIR)/des.Plo | |
1170 | -rm -f ./$(DEPDIR)/md4.Plo | |
1171 | -rm -f ./$(DEPDIR)/strverscmp.Plo | |
1172 | -rm -f ./$(DEPDIR)/unistd.Plo | |
1150 | 1173 | -rm -f Makefile |
1151 | 1174 | distclean-am: clean-am distclean-compile distclean-generic \ |
1152 | 1175 | distclean-local distclean-tags |
1192 | 1215 | installcheck-am: |
1193 | 1216 | |
1194 | 1217 | maintainer-clean: maintainer-clean-recursive |
1195 | -rm -rf ./$(DEPDIR) | |
1218 | -rm -f ./$(DEPDIR)/check-version.Plo | |
1219 | -rm -f ./$(DEPDIR)/des.Plo | |
1220 | -rm -f ./$(DEPDIR)/md4.Plo | |
1221 | -rm -f ./$(DEPDIR)/strverscmp.Plo | |
1222 | -rm -f ./$(DEPDIR)/unistd.Plo | |
1196 | 1223 | -rm -f Makefile |
1197 | 1224 | maintainer-clean-am: distclean-am maintainer-clean-generic |
1198 | 1225 | |
1214 | 1241 | .MAKE: $(am__recursive_targets) all check install install-am \ |
1215 | 1242 | install-strip |
1216 | 1243 | |
1217 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ | |
1218 | check-am clean clean-generic clean-libtool \ | |
1244 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ | |
1245 | am--depfiles check check-am clean clean-generic clean-libtool \ | |
1219 | 1246 | clean-noinstLIBRARIES clean-noinstLTLIBRARIES cscopelist-am \ |
1220 | 1247 | ctags ctags-am distclean distclean-compile distclean-generic \ |
1221 | 1248 | distclean-libtool distclean-local distclean-tags distdir dvi \ |
1321 | 1348 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ |
1322 | 1349 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ |
1323 | 1350 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ |
1324 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ | |
1325 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ | |
1326 | 1351 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ |
1327 | 1352 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ |
1328 | 1353 | @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ |
1466 | 1491 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ |
1467 | 1492 | -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ |
1468 | 1493 | -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ |
1494 | -e 's/@''GNULIB_ACCESS''@/$(GNULIB_ACCESS)/g' \ | |
1469 | 1495 | -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ |
1470 | 1496 | -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ |
1471 | 1497 | -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ |
1498 | -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GNULIB_COPY_FILE_RANGE)/g' \ | |
1472 | 1499 | -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ |
1473 | 1500 | -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ |
1474 | 1501 | -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ |
1487 | 1514 | -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ |
1488 | 1515 | -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ |
1489 | 1516 | -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ |
1517 | -e 's/@''GNULIB_GETOPT_POSIX''@/$(GNULIB_GETOPT_POSIX)/g' \ | |
1490 | 1518 | -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ |
1491 | 1519 | -e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \ |
1492 | 1520 | -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ |
1519 | 1547 | -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ |
1520 | 1548 | < $(srcdir)/unistd.in.h | \ |
1521 | 1549 | sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ |
1550 | -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ | |
1522 | 1551 | -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ |
1523 | 1552 | -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ |
1524 | 1553 | -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ |
1563 | 1592 | -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ |
1564 | 1593 | -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ |
1565 | 1594 | | \ |
1566 | sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ | |
1595 | sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \ | |
1596 | -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ | |
1567 | 1597 | -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ |
1568 | 1598 | -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ |
1569 | 1599 | -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ |
0 | 0 | /* A C macro for declaring that specific arguments must not be NULL. |
1 | Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify it |
4 | 4 | under the terms of the GNU Lesser General Public License as published |
0 | 0 | /* byteswap.h - Byte swapping |
1 | Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005. |
3 | 3 | |
4 | 4 | This program is free software: you can redistribute it and/or modify |
0 | 0 | /* C++ compatible function declaration macros. |
1 | Copyright (C) 2010-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify it |
4 | 4 | under the terms of the GNU Lesser General Public License as published |
300 | 300 | _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ |
301 | 301 | "The symbol ::" #func " refers to the system function. " \ |
302 | 302 | "Use " #namespace "::" #func " instead.") |
303 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING | |
304 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ | |
305 | extern __typeof__ (func) func | |
306 | 303 | # else |
307 | 304 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
308 | 305 | _GL_EXTERN_C int _gl_cxxalias_dummy |
0 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
1 | This file is part of the GNU C Library. | |
2 | ||
3 | The GNU C Library is free software; you can redistribute it and/or | |
4 | modify it under the terms of the GNU Lesser General Public | |
5 | License as published by the Free Software Foundation; either | |
6 | version 2.1 of the License, or (at your option) any later version. | |
7 | ||
8 | The GNU C Library is distributed in the hope that it will be useful, | |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
11 | Lesser General Public License for more details. | |
12 | ||
13 | You should have received a copy of the GNU Lesser General Public | |
14 | License along with the GNU C Library; if not, see | |
15 | <https://www.gnu.org/licenses/>. */ | |
16 | ||
17 | #ifndef _SYS_CDEFS_H | |
18 | #define _SYS_CDEFS_H 1 | |
19 | ||
20 | /* We are almost always included from features.h. */ | |
21 | #ifndef _FEATURES_H | |
22 | # include <features.h> | |
23 | #endif | |
24 | ||
25 | /* The GNU libc does not support any K&R compilers or the traditional mode | |
26 | of ISO C compilers anymore. Check for some of the combinations not | |
27 | anymore supported. */ | |
28 | #if defined __GNUC__ && !defined __STDC__ | |
29 | # error "You need a ISO C conforming compiler to use the glibc headers" | |
30 | #endif | |
31 | ||
32 | /* Some user header file might have defined this before. */ | |
33 | #undef __P | |
34 | #undef __PMT | |
35 | ||
36 | #ifdef __GNUC__ | |
37 | ||
38 | /* All functions, except those with callbacks or those that | |
39 | synchronize memory, are leaf functions. */ | |
40 | # if __GNUC_PREREQ (4, 6) && !defined _LIBC | |
41 | # define __LEAF , __leaf__ | |
42 | # define __LEAF_ATTR __attribute__ ((__leaf__)) | |
43 | # else | |
44 | # define __LEAF | |
45 | # define __LEAF_ATTR | |
46 | # endif | |
47 | ||
48 | /* GCC can always grok prototypes. For C++ programs we add throw() | |
49 | to help it optimize the function calls. But this works only with | |
50 | gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions | |
51 | as non-throwing using a function attribute since programs can use | |
52 | the -fexceptions options for C code as well. */ | |
53 | # if !defined __cplusplus && __GNUC_PREREQ (3, 3) | |
54 | # define __THROW __attribute__ ((__nothrow__ __LEAF)) | |
55 | # define __THROWNL __attribute__ ((__nothrow__)) | |
56 | # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct | |
57 | # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct | |
58 | # else | |
59 | # if defined __cplusplus && __GNUC_PREREQ (2,8) | |
60 | # define __THROW throw () | |
61 | # define __THROWNL throw () | |
62 | # define __NTH(fct) __LEAF_ATTR fct throw () | |
63 | # define __NTHNL(fct) fct throw () | |
64 | # else | |
65 | # define __THROW | |
66 | # define __THROWNL | |
67 | # define __NTH(fct) fct | |
68 | # define __NTHNL(fct) fct | |
69 | # endif | |
70 | # endif | |
71 | ||
72 | #else /* Not GCC. */ | |
73 | ||
74 | # if (defined __cplusplus \ | |
75 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) | |
76 | # define __inline inline | |
77 | # else | |
78 | # define __inline /* No inline functions. */ | |
79 | # endif | |
80 | ||
81 | # define __THROW | |
82 | # define __THROWNL | |
83 | # define __NTH(fct) fct | |
84 | ||
85 | #endif /* GCC. */ | |
86 | ||
87 | /* Compilers that are not clang may object to | |
88 | #if defined __clang__ && __has_extension(...) | |
89 | even though they do not need to evaluate the right-hand side of the &&. */ | |
90 | #if defined __clang__ && defined __has_extension | |
91 | # define __glibc_clang_has_extension(ext) __has_extension (ext) | |
92 | #else | |
93 | # define __glibc_clang_has_extension(ext) 0 | |
94 | #endif | |
95 | ||
96 | /* These two macros are not used in glibc anymore. They are kept here | |
97 | only because some other projects expect the macros to be defined. */ | |
98 | #define __P(args) args | |
99 | #define __PMT(args) args | |
100 | ||
101 | /* For these things, GCC behaves the ANSI way normally, | |
102 | and the non-ANSI way under -traditional. */ | |
103 | ||
104 | #define __CONCAT(x,y) x ## y | |
105 | #define __STRING(x) #x | |
106 | ||
107 | /* This is not a typedef so `const __ptr_t' does the right thing. */ | |
108 | #define __ptr_t void * | |
109 | ||
110 | ||
111 | /* C++ needs to know that types and declarations are C, not C++. */ | |
112 | #ifdef __cplusplus | |
113 | # define __BEGIN_DECLS extern "C" { | |
114 | # define __END_DECLS } | |
115 | #else | |
116 | # define __BEGIN_DECLS | |
117 | # define __END_DECLS | |
118 | #endif | |
119 | ||
120 | ||
121 | /* Fortify support. */ | |
122 | #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) | |
123 | #define __bos0(ptr) __builtin_object_size (ptr, 0) | |
124 | ||
125 | #if __GNUC_PREREQ (4,3) | |
126 | # define __warndecl(name, msg) \ | |
127 | extern void name (void) __attribute__((__warning__ (msg))) | |
128 | # define __warnattr(msg) __attribute__((__warning__ (msg))) | |
129 | # define __errordecl(name, msg) \ | |
130 | extern void name (void) __attribute__((__error__ (msg))) | |
131 | #else | |
132 | # define __warndecl(name, msg) extern void name (void) | |
133 | # define __warnattr(msg) | |
134 | # define __errordecl(name, msg) extern void name (void) | |
135 | #endif | |
136 | ||
137 | /* Support for flexible arrays. | |
138 | Headers that should use flexible arrays only if they're "real" | |
139 | (e.g. only if they won't affect sizeof()) should test | |
140 | #if __glibc_c99_flexarr_available. */ | |
141 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc | |
142 | # define __flexarr [] | |
143 | # define __glibc_c99_flexarr_available 1 | |
144 | #elif __GNUC_PREREQ (2,97) | |
145 | /* GCC 2.97 supports C99 flexible array members as an extension, | |
146 | even when in C89 mode or compiling C++ (any version). */ | |
147 | # define __flexarr [] | |
148 | # define __glibc_c99_flexarr_available 1 | |
149 | #elif defined __GNUC__ | |
150 | /* Pre-2.97 GCC did not support C99 flexible arrays but did have | |
151 | an equivalent extension with slightly different notation. */ | |
152 | # define __flexarr [0] | |
153 | # define __glibc_c99_flexarr_available 1 | |
154 | #else | |
155 | /* Some other non-C99 compiler. Approximate with [1]. */ | |
156 | # define __flexarr [1] | |
157 | # define __glibc_c99_flexarr_available 0 | |
158 | #endif | |
159 | ||
160 | ||
161 | /* __asm__ ("xyz") is used throughout the headers to rename functions | |
162 | at the assembly language level. This is wrapped by the __REDIRECT | |
163 | macro, in order to support compilers that can do this some other | |
164 | way. When compilers don't support asm-names at all, we have to do | |
165 | preprocessor tricks instead (which don't have exactly the right | |
166 | semantics, but it's the best we can do). | |
167 | ||
168 | Example: | |
169 | int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ | |
170 | ||
171 | #if defined __GNUC__ && __GNUC__ >= 2 | |
172 | ||
173 | # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) | |
174 | # ifdef __cplusplus | |
175 | # define __REDIRECT_NTH(name, proto, alias) \ | |
176 | name proto __THROW __asm__ (__ASMNAME (#alias)) | |
177 | # define __REDIRECT_NTHNL(name, proto, alias) \ | |
178 | name proto __THROWNL __asm__ (__ASMNAME (#alias)) | |
179 | # else | |
180 | # define __REDIRECT_NTH(name, proto, alias) \ | |
181 | name proto __asm__ (__ASMNAME (#alias)) __THROW | |
182 | # define __REDIRECT_NTHNL(name, proto, alias) \ | |
183 | name proto __asm__ (__ASMNAME (#alias)) __THROWNL | |
184 | # endif | |
185 | # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) | |
186 | # define __ASMNAME2(prefix, cname) __STRING (prefix) cname | |
187 | ||
188 | /* | |
189 | #elif __SOME_OTHER_COMPILER__ | |
190 | ||
191 | # define __REDIRECT(name, proto, alias) name proto; \ | |
192 | _Pragma("let " #name " = " #alias) | |
193 | */ | |
194 | #endif | |
195 | ||
196 | /* GCC has various useful declarations that can be made with the | |
197 | `__attribute__' syntax. All of the ways we use this do fine if | |
198 | they are omitted for compilers that don't understand it. */ | |
199 | #if !defined __GNUC__ || __GNUC__ < 2 | |
200 | # define __attribute__(xyz) /* Ignore */ | |
201 | #endif | |
202 | ||
203 | /* At some point during the gcc 2.96 development the `malloc' attribute | |
204 | for functions was introduced. We don't want to use it unconditionally | |
205 | (although this would be possible) since it generates warnings. */ | |
206 | #if __GNUC_PREREQ (2,96) | |
207 | # define __attribute_malloc__ __attribute__ ((__malloc__)) | |
208 | #else | |
209 | # define __attribute_malloc__ /* Ignore */ | |
210 | #endif | |
211 | ||
212 | /* Tell the compiler which arguments to an allocation function | |
213 | indicate the size of the allocation. */ | |
214 | #if __GNUC_PREREQ (4, 3) | |
215 | # define __attribute_alloc_size__(params) \ | |
216 | __attribute__ ((__alloc_size__ params)) | |
217 | #else | |
218 | # define __attribute_alloc_size__(params) /* Ignore. */ | |
219 | #endif | |
220 | ||
221 | /* At some point during the gcc 2.96 development the `pure' attribute | |
222 | for functions was introduced. We don't want to use it unconditionally | |
223 | (although this would be possible) since it generates warnings. */ | |
224 | #if __GNUC_PREREQ (2,96) | |
225 | # define __attribute_pure__ __attribute__ ((__pure__)) | |
226 | #else | |
227 | # define __attribute_pure__ /* Ignore */ | |
228 | #endif | |
229 | ||
230 | /* This declaration tells the compiler that the value is constant. */ | |
231 | #if __GNUC_PREREQ (2,5) | |
232 | # define __attribute_const__ __attribute__ ((__const__)) | |
233 | #else | |
234 | # define __attribute_const__ /* Ignore */ | |
235 | #endif | |
236 | ||
237 | /* At some point during the gcc 3.1 development the `used' attribute | |
238 | for functions was introduced. We don't want to use it unconditionally | |
239 | (although this would be possible) since it generates warnings. */ | |
240 | #if __GNUC_PREREQ (3,1) | |
241 | # define __attribute_used__ __attribute__ ((__used__)) | |
242 | # define __attribute_noinline__ __attribute__ ((__noinline__)) | |
243 | #else | |
244 | # define __attribute_used__ __attribute__ ((__unused__)) | |
245 | # define __attribute_noinline__ /* Ignore */ | |
246 | #endif | |
247 | ||
248 | /* Since version 3.2, gcc allows marking deprecated functions. */ | |
249 | #if __GNUC_PREREQ (3,2) | |
250 | # define __attribute_deprecated__ __attribute__ ((__deprecated__)) | |
251 | #else | |
252 | # define __attribute_deprecated__ /* Ignore */ | |
253 | #endif | |
254 | ||
255 | /* Since version 4.5, gcc also allows one to specify the message printed | |
256 | when a deprecated function is used. clang claims to be gcc 4.2, but | |
257 | may also support this feature. */ | |
258 | #if __GNUC_PREREQ (4,5) || \ | |
259 | __glibc_clang_has_extension (__attribute_deprecated_with_message__) | |
260 | # define __attribute_deprecated_msg__(msg) \ | |
261 | __attribute__ ((__deprecated__ (msg))) | |
262 | #else | |
263 | # define __attribute_deprecated_msg__(msg) __attribute_deprecated__ | |
264 | #endif | |
265 | ||
266 | /* At some point during the gcc 2.8 development the `format_arg' attribute | |
267 | for functions was introduced. We don't want to use it unconditionally | |
268 | (although this would be possible) since it generates warnings. | |
269 | If several `format_arg' attributes are given for the same function, in | |
270 | gcc-3.0 and older, all but the last one are ignored. In newer gccs, | |
271 | all designated arguments are considered. */ | |
272 | #if __GNUC_PREREQ (2,8) | |
273 | # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) | |
274 | #else | |
275 | # define __attribute_format_arg__(x) /* Ignore */ | |
276 | #endif | |
277 | ||
278 | /* At some point during the gcc 2.97 development the `strfmon' format | |
279 | attribute for functions was introduced. We don't want to use it | |
280 | unconditionally (although this would be possible) since it | |
281 | generates warnings. */ | |
282 | #if __GNUC_PREREQ (2,97) | |
283 | # define __attribute_format_strfmon__(a,b) \ | |
284 | __attribute__ ((__format__ (__strfmon__, a, b))) | |
285 | #else | |
286 | # define __attribute_format_strfmon__(a,b) /* Ignore */ | |
287 | #endif | |
288 | ||
289 | /* The nonnull function attribute marks pointer parameters that | |
290 | must not be NULL. Do not define __nonnull if it is already defined, | |
291 | for portability when this file is used in Gnulib. */ | |
292 | #ifndef __nonnull | |
293 | # if __GNUC_PREREQ (3,3) | |
294 | # define __nonnull(params) __attribute__ ((__nonnull__ params)) | |
295 | # else | |
296 | # define __nonnull(params) | |
297 | # endif | |
298 | #endif | |
299 | ||
300 | /* If fortification mode, we warn about unused results of certain | |
301 | function calls which can lead to problems. */ | |
302 | #if __GNUC_PREREQ (3,4) | |
303 | # define __attribute_warn_unused_result__ \ | |
304 | __attribute__ ((__warn_unused_result__)) | |
305 | # if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 | |
306 | # define __wur __attribute_warn_unused_result__ | |
307 | # endif | |
308 | #else | |
309 | # define __attribute_warn_unused_result__ /* empty */ | |
310 | #endif | |
311 | #ifndef __wur | |
312 | # define __wur /* Ignore */ | |
313 | #endif | |
314 | ||
315 | /* Forces a function to be always inlined. */ | |
316 | #if __GNUC_PREREQ (3,2) | |
317 | /* The Linux kernel defines __always_inline in stddef.h (283d7573), and | |
318 | it conflicts with this definition. Therefore undefine it first to | |
319 | allow either header to be included first. */ | |
320 | # undef __always_inline | |
321 | # define __always_inline __inline __attribute__ ((__always_inline__)) | |
322 | #else | |
323 | # undef __always_inline | |
324 | # define __always_inline __inline | |
325 | #endif | |
326 | ||
327 | /* Associate error messages with the source location of the call site rather | |
328 | than with the source location inside the function. */ | |
329 | #if __GNUC_PREREQ (4,3) | |
330 | # define __attribute_artificial__ __attribute__ ((__artificial__)) | |
331 | #else | |
332 | # define __attribute_artificial__ /* Ignore */ | |
333 | #endif | |
334 | ||
335 | /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 | |
336 | inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ | |
337 | or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions | |
338 | older than 4.3 may define these macros and still not guarantee GNU inlining | |
339 | semantics. | |
340 | ||
341 | clang++ identifies itself as gcc-4.2, but has support for GNU inlining | |
342 | semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and | |
343 | __GNUC_GNU_INLINE__ macro definitions. */ | |
344 | #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ | |
345 | || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ | |
346 | || defined __GNUC_GNU_INLINE__))) | |
347 | # if defined __GNUC_STDC_INLINE__ || defined __cplusplus | |
348 | # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) | |
349 | # define __extern_always_inline \ | |
350 | extern __always_inline __attribute__ ((__gnu_inline__)) | |
351 | # else | |
352 | # define __extern_inline extern __inline | |
353 | # define __extern_always_inline extern __always_inline | |
354 | # endif | |
355 | #endif | |
356 | ||
357 | #ifdef __extern_always_inline | |
358 | # define __fortify_function __extern_always_inline __attribute_artificial__ | |
359 | #endif | |
360 | ||
361 | /* GCC 4.3 and above allow passing all anonymous arguments of an | |
362 | __extern_always_inline function to some other vararg function. */ | |
363 | #if __GNUC_PREREQ (4,3) | |
364 | # define __va_arg_pack() __builtin_va_arg_pack () | |
365 | # define __va_arg_pack_len() __builtin_va_arg_pack_len () | |
366 | #endif | |
367 | ||
368 | /* It is possible to compile containing GCC extensions even if GCC is | |
369 | run in pedantic mode if the uses are carefully marked using the | |
370 | `__extension__' keyword. But this is not generally available before | |
371 | version 2.8. */ | |
372 | #if !__GNUC_PREREQ (2,8) | |
373 | # define __extension__ /* Ignore */ | |
374 | #endif | |
375 | ||
376 | /* __restrict is known in EGCS 1.2 and above. */ | |
377 | #if !__GNUC_PREREQ (2,92) | |
378 | # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | |
379 | # define __restrict restrict | |
380 | # else | |
381 | # define __restrict /* Ignore */ | |
382 | # endif | |
383 | #endif | |
384 | ||
385 | /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is | |
386 | array_name[restrict] | |
387 | GCC 3.1 supports this. */ | |
388 | #if __GNUC_PREREQ (3,1) && !defined __GNUG__ | |
389 | # define __restrict_arr __restrict | |
390 | #else | |
391 | # ifdef __GNUC__ | |
392 | # define __restrict_arr /* Not supported in old GCC. */ | |
393 | # else | |
394 | # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | |
395 | # define __restrict_arr restrict | |
396 | # else | |
397 | /* Some other non-C99 compiler. */ | |
398 | # define __restrict_arr /* Not supported. */ | |
399 | # endif | |
400 | # endif | |
401 | #endif | |
402 | ||
403 | #if __GNUC__ >= 3 | |
404 | # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) | |
405 | # define __glibc_likely(cond) __builtin_expect ((cond), 1) | |
406 | #else | |
407 | # define __glibc_unlikely(cond) (cond) | |
408 | # define __glibc_likely(cond) (cond) | |
409 | #endif | |
410 | ||
411 | #ifdef __has_attribute | |
412 | # define __glibc_has_attribute(attr) __has_attribute (attr) | |
413 | #else | |
414 | # define __glibc_has_attribute(attr) 0 | |
415 | #endif | |
416 | ||
417 | #if (!defined _Noreturn \ | |
418 | && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ | |
419 | && !__GNUC_PREREQ (4,7)) | |
420 | # if __GNUC_PREREQ (2,8) | |
421 | # define _Noreturn __attribute__ ((__noreturn__)) | |
422 | # else | |
423 | # define _Noreturn | |
424 | # endif | |
425 | #endif | |
426 | ||
427 | #if __GNUC_PREREQ (8, 0) | |
428 | /* Describes a char array whose address can safely be passed as the first | |
429 | argument to strncpy and strncat, as the char array is not necessarily | |
430 | a NUL-terminated string. */ | |
431 | # define __attribute_nonstring__ __attribute__ ((__nonstring__)) | |
432 | #else | |
433 | # define __attribute_nonstring__ | |
434 | #endif | |
435 | ||
436 | #if (!defined _Static_assert && !defined __cplusplus \ | |
437 | && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ | |
438 | && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) | |
439 | # define _Static_assert(expr, diagnostic) \ | |
440 | extern int (*__Static_assert_function (void)) \ | |
441 | [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] | |
442 | #endif | |
443 | ||
444 | /* The #ifndef lets Gnulib avoid including these on non-glibc | |
445 | platforms, where the includes typically do not exist. */ | |
446 | #ifndef __WORDSIZE | |
447 | # include <bits/wordsize.h> | |
448 | # include <bits/long-double.h> | |
449 | #endif | |
450 | ||
451 | #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH | |
452 | # define __LDBL_COMPAT 1 | |
453 | # ifdef __REDIRECT | |
454 | # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) | |
455 | # define __LDBL_REDIR(name, proto) \ | |
456 | __LDBL_REDIR1 (name, proto, __nldbl_##name) | |
457 | # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) | |
458 | # define __LDBL_REDIR_NTH(name, proto) \ | |
459 | __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) | |
460 | # define __LDBL_REDIR1_DECL(name, alias) \ | |
461 | extern __typeof (name) name __asm (__ASMNAME (#alias)); | |
462 | # define __LDBL_REDIR_DECL(name) \ | |
463 | extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); | |
464 | # define __REDIRECT_LDBL(name, proto, alias) \ | |
465 | __LDBL_REDIR1 (name, proto, __nldbl_##alias) | |
466 | # define __REDIRECT_NTH_LDBL(name, proto, alias) \ | |
467 | __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) | |
468 | # endif | |
469 | #endif | |
470 | #if !defined __LDBL_COMPAT || !defined __REDIRECT | |
471 | # define __LDBL_REDIR1(name, proto, alias) name proto | |
472 | # define __LDBL_REDIR(name, proto) name proto | |
473 | # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW | |
474 | # define __LDBL_REDIR_NTH(name, proto) name proto __THROW | |
475 | # define __LDBL_REDIR_DECL(name) | |
476 | # ifdef __REDIRECT | |
477 | # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) | |
478 | # define __REDIRECT_NTH_LDBL(name, proto, alias) \ | |
479 | __REDIRECT_NTH (name, proto, alias) | |
480 | # endif | |
481 | #endif | |
482 | ||
483 | /* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is | |
484 | intended for use in preprocessor macros. | |
485 | ||
486 | Note: MESSAGE must be a _single_ string; concatenation of string | |
487 | literals is not supported. */ | |
488 | #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) | |
489 | # define __glibc_macro_warning1(message) _Pragma (#message) | |
490 | # define __glibc_macro_warning(message) \ | |
491 | __glibc_macro_warning1 (GCC warning message) | |
492 | #else | |
493 | # define __glibc_macro_warning(msg) | |
494 | #endif | |
495 | ||
496 | /* Generic selection (ISO C11) is a C-only feature, available in GCC | |
497 | since version 4.9. Previous versions do not provide generic | |
498 | selection, even though they might set __STDC_VERSION__ to 201112L, | |
499 | when in -std=c11 mode. Thus, we must check for !defined __GNUC__ | |
500 | when testing __STDC_VERSION__ for generic selection support. | |
501 | On the other hand, Clang also defines __GNUC__, so a clang-specific | |
502 | check is required to enable the use of generic selection. */ | |
503 | #if !defined __cplusplus \ | |
504 | && (__GNUC_PREREQ (4, 9) \ | |
505 | || __glibc_clang_has_extension (c_generic_selections) \ | |
506 | || (!defined __GNUC__ && defined __STDC_VERSION__ \ | |
507 | && __STDC_VERSION__ >= 201112L)) | |
508 | # define __HAVE_GENERIC_SELECTION 1 | |
509 | #else | |
510 | # define __HAVE_GENERIC_SELECTION 0 | |
511 | #endif | |
512 | ||
513 | #endif /* sys/cdefs.h */ |
0 | 0 | /* check-version.h --- Check version string compatibility. |
1 | Copyright (C) 1998-2006, 2008-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 1998-2006, 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software; you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU Lesser General Public License as published by |
0 | 0 | /* check-version.h --- Check version string compatibility. |
1 | Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software; you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU Lesser General Public License as published by |
0 | 0 | /* des.c --- DES and Triple-DES encryption/decryption Algorithm |
1 | * Copyright (C) 1998-1999, 2001-2007, 2009-2018 Free Software Foundation, Inc. | |
1 | * Copyright (C) 1998-1999, 2001-2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | * |
3 | 3 | * This file is free software; you can redistribute it and/or modify |
4 | 4 | * it under the terms of the GNU Lesser General Public License as published |
406 | 406 | * Macros to convert 8 bytes from/to 32bit words. |
407 | 407 | */ |
408 | 408 | #define READ_64BIT_DATA(data, left, right) \ |
409 | left = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; \ | |
410 | right = (data[4] << 24) | (data[5] << 16) | (data[6] << 8) | data[7]; | |
409 | left = ((uint32_t) data[0] << 24) \ | |
410 | | ((uint32_t) data[1] << 16) \ | |
411 | | ((uint32_t) data[2] << 8) \ | |
412 | | (uint32_t) data[3]; \ | |
413 | right = ((uint32_t) data[4] << 24) \ | |
414 | | ((uint32_t) data[5] << 16) \ | |
415 | | ((uint32_t) data[6] << 8) \ | |
416 | | (uint32_t) data[7]; | |
411 | 417 | |
412 | 418 | #define WRITE_64BIT_DATA(data, left, right) \ |
413 | data[0] = (left >> 24) &0xff; data[1] = (left >> 16) &0xff; \ | |
419 | data[0] = (left >> 24) &0xff; data[1] = (left >> 16) &0xff; \ | |
414 | 420 | data[2] = (left >> 8) &0xff; data[3] = left &0xff; \ |
415 | 421 | data[4] = (right >> 24) &0xff; data[5] = (right >> 16) &0xff; \ |
416 | 422 | data[6] = (right >> 8) &0xff; data[7] = right &0xff; |
0 | 0 | /* des.h --- DES cipher implementation. |
1 | * Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. | |
1 | * Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | * |
3 | 3 | * This file is free software; you can redistribute it and/or modify |
4 | 4 | * it under the terms of the GNU Lesser General Public License as published |
0 | /* System definitions for code taken from the GNU C Library | |
1 | ||
2 | Copyright 2017-2020 Free Software Foundation, Inc. | |
3 | ||
4 | This program is free software; you can redistribute it and/or | |
5 | modify it under the terms of the GNU Lesser General Public | |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | Lesser General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Lesser General Public | |
15 | License along with this program; if not, see | |
16 | <https://www.gnu.org/licenses/>. */ | |
17 | ||
18 | /* Written by Paul Eggert. */ | |
19 | ||
20 | /* This is intended to be a good-enough substitute for glibc system | |
21 | macros like those defined in <sys/cdefs.h>, so that Gnulib code | |
22 | shared with glibc can do this as the first #include: | |
23 | ||
24 | #ifndef _LIBC | |
25 | # include <libc-config.h> | |
26 | #endif | |
27 | ||
28 | When compiled as part of glibc this is a no-op; when compiled as | |
29 | part of Gnulib this includes Gnulib's <config.h> and defines macros | |
30 | that glibc library code would normally assume. */ | |
31 | ||
32 | #include <config.h> | |
33 | ||
34 | /* On glibc this includes <features.h> and <sys/cdefs.h> and #defines | |
35 | _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it | |
36 | includes <sys/cdefs.h> which defines __nonnull. Elsewhere it | |
37 | is harmless. */ | |
38 | #include <errno.h> | |
39 | ||
40 | /* From glibc <errno.h>. */ | |
41 | #ifndef __set_errno | |
42 | # define __set_errno(val) (errno = (val)) | |
43 | #endif | |
44 | ||
45 | /* From glibc <features.h>. */ | |
46 | ||
47 | #ifndef __GNUC_PREREQ | |
48 | # if defined __GNUC__ && defined __GNUC_MINOR__ | |
49 | # define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__)) | |
50 | # else | |
51 | # define __GNUC_PREREQ(maj, min) 0 | |
52 | # endif | |
53 | #endif | |
54 | ||
55 | #ifndef __glibc_clang_prereq | |
56 | # if defined __clang_major__ && defined __clang_minor__ | |
57 | # ifdef __apple_build_version__ | |
58 | /* Apple for some reason renumbers __clang_major__ and __clang_minor__. | |
59 | Gnulib code uses only __glibc_clang_prereq (3, 5); map it to | |
60 | 6000000 <= __apple_build_version__. Support for other calls to | |
61 | __glibc_clang_prereq can be added here as needed. */ | |
62 | # define __glibc_clang_prereq(maj, min) \ | |
63 | ((maj) == 3 && (min) == 5 ? 6000000 <= __apple_build_version__ : 0) | |
64 | # else | |
65 | # define __glibc_clang_prereq(maj, min) \ | |
66 | ((maj) < __clang_major__ + ((min) <= __clang_minor__)) | |
67 | # endif | |
68 | # else | |
69 | # define __glibc_clang_prereq(maj, min) 0 | |
70 | # endif | |
71 | #endif | |
72 | ||
73 | ||
74 | /* Prepare to include <cdefs.h>, which is our copy of glibc | |
75 | <sys/cdefs.h>. */ | |
76 | ||
77 | /* Define _FEATURES_H so that <cdefs.h> does not include <features.h>. */ | |
78 | #ifndef _FEATURES_H | |
79 | # define _FEATURES_H 1 | |
80 | #endif | |
81 | /* Define __WORDSIZE so that <cdefs.h> does not attempt to include | |
82 | nonexistent files. Make it a syntax error, since Gnulib does not | |
83 | use __WORDSIZE now, and if Gnulib uses it later the syntax error | |
84 | will let us know that __WORDSIZE needs configuring. */ | |
85 | #ifndef __WORDSIZE | |
86 | # define __WORDSIZE %%% | |
87 | #endif | |
88 | /* Undef the macros unconditionally defined by our copy of glibc | |
89 | <sys/cdefs.h>, so that they do not clash with any system-defined | |
90 | versions. */ | |
91 | #undef _SYS_CDEFS_H | |
92 | #undef __ASMNAME | |
93 | #undef __ASMNAME2 | |
94 | #undef __BEGIN_DECLS | |
95 | #undef __CONCAT | |
96 | #undef __END_DECLS | |
97 | #undef __HAVE_GENERIC_SELECTION | |
98 | #undef __LDBL_COMPAT | |
99 | #undef __LDBL_REDIR | |
100 | #undef __LDBL_REDIR1 | |
101 | #undef __LDBL_REDIR1_DECL | |
102 | #undef __LDBL_REDIR1_NTH | |
103 | #undef __LDBL_REDIR_DECL | |
104 | #undef __LDBL_REDIR_NTH | |
105 | #undef __LEAF | |
106 | #undef __LEAF_ATTR | |
107 | #undef __NTH | |
108 | #undef __NTHNL | |
109 | #undef __P | |
110 | #undef __PMT | |
111 | #undef __REDIRECT | |
112 | #undef __REDIRECT_LDBL | |
113 | #undef __REDIRECT_NTH | |
114 | #undef __REDIRECT_NTHNL | |
115 | #undef __REDIRECT_NTH_LDBL | |
116 | #undef __STRING | |
117 | #undef __THROW | |
118 | #undef __THROWNL | |
119 | #undef __always_inline | |
120 | #undef __attribute__ | |
121 | #undef __attribute_alloc_size__ | |
122 | #undef __attribute_artificial__ | |
123 | #undef __attribute_const__ | |
124 | #undef __attribute_deprecated__ | |
125 | #undef __attribute_deprecated_msg__ | |
126 | #undef __attribute_format_arg__ | |
127 | #undef __attribute_format_strfmon__ | |
128 | #undef __attribute_malloc__ | |
129 | #undef __attribute_noinline__ | |
130 | #undef __attribute_nonstring__ | |
131 | #undef __attribute_pure__ | |
132 | #undef __attribute_used__ | |
133 | #undef __attribute_warn_unused_result__ | |
134 | #undef __bos | |
135 | #undef __bos0 | |
136 | #undef __errordecl | |
137 | #undef __extension__ | |
138 | #undef __extern_always_inline | |
139 | #undef __extern_inline | |
140 | #undef __flexarr | |
141 | #undef __fortify_function | |
142 | #undef __glibc_c99_flexarr_available | |
143 | #undef __glibc_clang_has_extension | |
144 | #undef __glibc_likely | |
145 | #undef __glibc_macro_warning | |
146 | #undef __glibc_macro_warning1 | |
147 | #undef __glibc_unlikely | |
148 | #undef __inline | |
149 | #undef __ptr_t | |
150 | #undef __restrict | |
151 | #undef __restrict_arr | |
152 | #undef __va_arg_pack | |
153 | #undef __va_arg_pack_len | |
154 | #undef __warnattr | |
155 | #undef __warndecl | |
156 | ||
157 | /* Include our copy of glibc <sys/cdefs.h>. */ | |
158 | #include <cdefs.h> | |
159 | ||
160 | /* <cdefs.h> __inline is too pessimistic for non-GCC. */ | |
161 | #undef __inline | |
162 | #ifndef HAVE___INLINE | |
163 | # if 199901 <= __STDC_VERSION__ || defined inline | |
164 | # define __inline inline | |
165 | # else | |
166 | # define __inline | |
167 | # endif | |
168 | #endif | |
169 | ||
170 | ||
171 | /* A substitute for glibc <libc-symbols.h>, good enough for Gnulib. */ | |
172 | #define attribute_hidden | |
173 | #define libc_hidden_proto(name, ...) | |
174 | #define libc_hidden_def(name) | |
175 | #define libc_hidden_weak(name) | |
176 | #define libc_hidden_ver(local, name) | |
177 | #define strong_alias(name, aliasname) | |
178 | #define weak_alias(name, aliasname) | |
179 | ||
180 | /* A substitute for glibc <shlib-compat.h>, good enough for Gnulib. */ | |
181 | #define SHLIB_COMPAT(lib, introduced, obsoleted) 0 | |
182 | #define versioned_symbol(lib, local, symbol, version) |
0 | 0 | /* A GNU-like <limits.h>. |
1 | 1 | |
2 | Copyright 2016-2018 Free Software Foundation, Inc. | |
2 | Copyright 2016-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software; you can redistribute it and/or |
5 | 5 | modify it under the terms of the GNU Lesser General Public License |
27 | 27 | #ifndef _@GUARD_PREFIX@_LIMITS_H |
28 | 28 | #define _@GUARD_PREFIX@_LIMITS_H |
29 | 29 | |
30 | /* For HP-UX 11.31. */ | |
31 | #if defined LONG_LONG_MIN && !defined LLONG_MIN | |
32 | # define LLONG_MIN LONG_LONG_MIN | |
30 | #ifndef LLONG_MIN | |
31 | # if defined LONG_LONG_MIN /* HP-UX 11.31 */ | |
32 | # define LLONG_MIN LONG_LONG_MIN | |
33 | # elif defined LONGLONG_MIN /* IRIX 6.5 */ | |
34 | # define LLONG_MIN LONGLONG_MIN | |
35 | # elif defined __GNUC__ | |
36 | # define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL) | |
37 | # endif | |
33 | 38 | #endif |
34 | #if defined LONG_LONG_MAX && !defined LLONG_MAX | |
35 | # define LLONG_MAX LONG_LONG_MAX | |
39 | #ifndef LLONG_MAX | |
40 | # if defined LONG_LONG_MAX /* HP-UX 11.31 */ | |
41 | # define LLONG_MAX LONG_LONG_MAX | |
42 | # elif defined LONGLONG_MAX /* IRIX 6.5 */ | |
43 | # define LLONG_MAX LONGLONG_MAX | |
44 | # elif defined __GNUC__ | |
45 | # define LLONG_MAX __LONG_LONG_MAX__ | |
46 | # endif | |
36 | 47 | #endif |
37 | #if defined ULONG_LONG_MAX && !defined ULLONG_MAX | |
38 | # define ULLONG_MAX ULONG_LONG_MAX | |
48 | #ifndef ULLONG_MAX | |
49 | # if defined ULONG_LONG_MAX /* HP-UX 11.31 */ | |
50 | # define ULLONG_MAX ULONG_LONG_MAX | |
51 | # elif defined ULONGLONG_MAX /* IRIX 6.5 */ | |
52 | # define ULLONG_MAX ULONGLONG_MAX | |
53 | # elif defined __GNUC__ | |
54 | # define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL) | |
55 | # endif | |
39 | 56 | #endif |
40 | 57 | |
41 | 58 | /* The number of usable bits in an unsigned or signed integer type |
51 | 68 | #define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n)) |
52 | 69 | #define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n)) |
53 | 70 | #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) |
71 | ||
72 | #ifndef WORD_BIT | |
73 | /* Assume 'int' is 32 bits wide. */ | |
74 | # define WORD_BIT 32 | |
75 | #endif | |
76 | #ifndef LONG_BIT | |
77 | /* Assume 'long' is 32 or 64 bits wide. */ | |
78 | # if LONG_MAX == INT_MAX | |
79 | # define LONG_BIT 32 | |
80 | # else | |
81 | # define LONG_BIT 64 | |
82 | # endif | |
83 | #endif | |
54 | 84 | |
55 | 85 | /* Macros specified by ISO/IEC TS 18661-1:2014. */ |
56 | 86 |
0 | # 00gnulib.m4 serial 3 | |
1 | dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
0 | # 00gnulib.m4 serial 7 | |
1 | dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
5 | 5 | |
6 | 6 | dnl This file must be named something that sorts before all other |
7 | dnl gnulib-provided .m4 files. It is needed until such time as we can | |
8 | dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and | |
9 | dnl m4_divert semantics. | |
7 | dnl gnulib-provided .m4 files. The first part is needed until such time | |
8 | dnl as we can assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and | |
9 | dnl m4_divert semantics. The second part is needed until the clang fix | |
10 | dnl has been included in Autoconf. | |
10 | 11 | |
11 | 12 | # Until autoconf 2.63, handling of the diversion stack required m4_init |
12 | 13 | # to be called first; but this does not happen with aclocal. Wrapping |
38 | 39 | [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl |
39 | 40 | [AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) |
40 | 41 | |
42 | # The following definitions arrange to use a compiler option | |
43 | # -Werror=implicit-function-declaration in AC_CHECK_DECL, when the | |
44 | # compiler is clang. Without it, clang implicitly declares "known" | |
45 | # library functions in C mode, but not in C++ mode, which would cause | |
46 | # Gnulib to omit a declaration and thus later produce an error in C++ | |
47 | # mode. As of clang 9.0, these "known" functions are identified through | |
48 | # LIBBUILTIN invocations in the LLVM source file | |
49 | # llvm/tools/clang/include/clang/Basic/Builtins.def. | |
50 | # It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL, | |
51 | # because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed | |
52 | # to AC_REQUIRE anything: some configure.ac files have their first | |
53 | # AC_CHECK_DECL executed conditionally. Therefore append the extra tests | |
54 | # to AC_PROG_CC. | |
55 | AC_DEFUN([gl_COMPILER_CLANG], | |
56 | [ | |
57 | dnl AC_REQUIRE([AC_PROG_CC]) | |
58 | AC_CACHE_CHECK([whether the compiler is clang], | |
59 | [gl_cv_compiler_clang], | |
60 | [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error | |
61 | dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has | |
62 | dnl not yet been invoked. | |
63 | _AC_COMPILE_IFELSE( | |
64 | [AC_LANG_PROGRAM([[ | |
65 | #ifdef __clang__ | |
66 | barfbarf | |
67 | #endif | |
68 | ]],[[]]) | |
69 | ], | |
70 | [gl_cv_compiler_clang=no], | |
71 | [gl_cv_compiler_clang=yes]) | |
72 | ]) | |
73 | ]) | |
74 | AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL], | |
75 | [ | |
76 | dnl AC_REQUIRE([AC_PROG_CC]) | |
77 | dnl AC_REQUIRE([gl_COMPILER_CLANG]) | |
78 | AC_CACHE_CHECK([for compiler option needed when checking for declarations], | |
79 | [gl_cv_compiler_check_decl_option], | |
80 | [if test $gl_cv_compiler_clang = yes; then | |
81 | dnl Test whether the compiler supports the option | |
82 | dnl '-Werror=implicit-function-declaration'. | |
83 | save_ac_compile="$ac_compile" | |
84 | ac_compile="$ac_compile -Werror=implicit-function-declaration" | |
85 | dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a | |
86 | dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". | |
87 | _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], | |
88 | [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'], | |
89 | [gl_cv_compiler_check_decl_option=none]) | |
90 | ac_compile="$save_ac_compile" | |
91 | else | |
92 | gl_cv_compiler_check_decl_option=none | |
93 | fi | |
94 | ]) | |
95 | if test "x$gl_cv_compiler_check_decl_option" != xnone; then | |
96 | ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option" | |
97 | else | |
98 | ac_compile_for_check_decl="$ac_compile" | |
99 | fi | |
100 | ]) | |
101 | dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl | |
102 | dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC | |
103 | dnl in zzgnulib.m4 is inactive, use the original ac_compile. | |
104 | m4_define([_AC_CHECK_DECL_BODY], | |
105 | [ ac_save_ac_compile="$ac_compile" | |
106 | if test -n "$ac_compile_for_check_decl"; then | |
107 | ac_compile="$ac_compile_for_check_decl" | |
108 | fi] | |
109 | m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile" | |
110 | ]) | |
111 | ||
41 | 112 | # gl_00GNULIB |
42 | 113 | # ----------- |
43 | 114 | # Witness macro that this file has been included. Needed to force |
0 | # Test for __inline keyword | |
1 | dnl Copyright 2017-2020 Free Software Foundation, Inc. | |
2 | dnl This file is free software; the Free Software Foundation | |
3 | dnl gives unlimited permission to copy and/or distribute it, | |
4 | dnl with or without modifications, as long as this notice is preserved. | |
5 | ||
6 | AC_DEFUN([gl___INLINE], | |
7 | [ | |
8 | AC_CACHE_CHECK([whether the compiler supports the __inline keyword], | |
9 | [gl_cv_c___inline], | |
10 | [AC_COMPILE_IFELSE( | |
11 | [AC_LANG_PROGRAM( | |
12 | [[typedef int foo_t; | |
13 | static __inline foo_t foo (void) { return 0; }]], | |
14 | [[return foo ();]])], | |
15 | [gl_cv_c___inline=yes], | |
16 | [gl_cv_c___inline=no])]) | |
17 | if test $gl_cv_c___inline = yes; then | |
18 | AC_DEFINE([HAVE___INLINE], [1], | |
19 | [Define to 1 if the compiler supports the keyword '__inline'.]) | |
20 | fi | |
21 | ]) |
0 | 0 | # absolute-header.m4 serial 16 |
1 | dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # autobuild.m4 serial 7 |
1 | dnl Copyright (C) 2004, 2006-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2004, 2006-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # byteswap.m4 serial 4 |
1 | dnl Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # serial 18 -*- Autoconf -*- |
1 | 1 | # Enable extensions on systems that normally disable them. |
2 | 2 | |
3 | # Copyright (C) 2003, 2006-2018 Free Software Foundation, Inc. | |
3 | # Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc. | |
4 | 4 | # This file is free software; the Free Software Foundation |
5 | 5 | # gives unlimited permission to copy and/or distribute it, |
6 | 6 | # with or without modifications, as long as this notice is preserved. |
0 | 0 | dnl 'extern inline' a la ISO C99. |
1 | 1 | |
2 | dnl Copyright 2012-2018 Free Software Foundation, Inc. | |
2 | dnl Copyright 2012-2020 Free Software Foundation, Inc. | |
3 | 3 | dnl This file is free software; the Free Software Foundation |
4 | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | 5 | dnl with or without modifications, as long as this notice is preserved. |
31 | 31 | https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html |
32 | 32 | |
33 | 33 | DragonFly; see |
34 | http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log | |
34 | http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log | |
35 | 35 | |
36 | 36 | FreeBSD; see: |
37 | 37 | https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html |
0 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
0 | # Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
1 | 1 | # |
2 | 2 | # This file is free software; you can redistribute it and/or modify |
3 | 3 | # it under the terms of the GNU General Public License as published by |
49 | 49 | # manywarnings \ |
50 | 50 | # strverscmp \ |
51 | 51 | # unistd \ |
52 | # update-copyright \ | |
52 | 53 | # valgrind-tests \ |
53 | 54 | # warnings |
54 | 55 | |
65 | 66 | manywarnings |
66 | 67 | strverscmp |
67 | 68 | unistd |
69 | update-copyright | |
68 | 70 | valgrind-tests |
69 | 71 | warnings |
70 | 72 | ]) |
0 | # gnulib-common.m4 serial 39 | |
1 | dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. | |
0 | # gnulib-common.m4 serial 48 | |
1 | dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
5 | ||
6 | AC_PREREQ([2.62]) | |
5 | 7 | |
6 | 8 | # gl_COMMON |
7 | 9 | # is expanded unconditionally through gnulib-tool magic. |
9 | 11 | dnl Use AC_REQUIRE here, so that the code is expanded once only. |
10 | 12 | AC_REQUIRE([gl_00GNULIB]) |
11 | 13 | AC_REQUIRE([gl_COMMON_BODY]) |
14 | AC_REQUIRE([gl_ZZGNULIB]) | |
12 | 15 | ]) |
13 | 16 | AC_DEFUN([gl_COMMON_BODY], [ |
14 | 17 | AH_VERBATIM([_Noreturn], |
15 | 18 | [/* The _Noreturn keyword of C11. */ |
16 | #if ! (defined _Noreturn \ | |
17 | || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) | |
18 | # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ | |
19 | || 0x5110 <= __SUNPRO_C) | |
19 | #ifndef _Noreturn | |
20 | # if (defined __cplusplus \ | |
21 | && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ | |
22 | || (defined _MSC_VER && 1900 <= _MSC_VER)) \ | |
23 | && 0) | |
24 | /* [[noreturn]] is not practically usable, because with it the syntax | |
25 | extern _Noreturn void func (...); | |
26 | would not be valid; such a declaration would only be valid with 'extern' | |
27 | and '_Noreturn' swapped, or without the 'extern' keyword. However, some | |
28 | AIX system header files and several gnulib header files use precisely | |
29 | this syntax with 'extern'. */ | |
30 | # define _Noreturn [[noreturn]] | |
31 | # elif ((!defined __cplusplus || defined __clang__) \ | |
32 | && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ | |
33 | || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ | |
34 | || (defined __apple_build_version__ \ | |
35 | ? 6000000 <= __apple_build_version__ \ | |
36 | : 3 < __clang_major__ + (5 <= __clang_minor__)))) | |
37 | /* _Noreturn works as-is. */ | |
38 | # elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C | |
20 | 39 | # define _Noreturn __attribute__ ((__noreturn__)) |
21 | # elif defined _MSC_VER && 1200 <= _MSC_VER | |
40 | # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) | |
22 | 41 | # define _Noreturn __declspec (noreturn) |
23 | 42 | # else |
24 | 43 | # define _Noreturn |
79 | 98 | # define _GL_ATTRIBUTE_MALLOC /* empty */ |
80 | 99 | #endif |
81 | 100 | ]) |
101 | AH_VERBATIM([async_safe], | |
102 | [/* The _GL_ASYNC_SAFE marker should be attached to functions that are | |
103 | signal handlers (for signals other than SIGABRT, SIGPIPE) or can be | |
104 | invoked from such signal handlers. Such functions have some restrictions: | |
105 | * All functions that it calls should be marked _GL_ASYNC_SAFE as well, | |
106 | or should be listed as async-signal-safe in POSIX | |
107 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04> | |
108 | section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in | |
109 | particular, are NOT async-signal-safe. | |
110 | * All memory locations (variables and struct fields) that these functions | |
111 | access must be marked 'volatile'. This holds for both read and write | |
112 | accesses. Otherwise the compiler might optimize away stores to and | |
113 | reads from such locations that occur in the program, depending on its | |
114 | data flow analysis. For example, when the program contains a loop | |
115 | that is intended to inspect a variable set from within a signal handler | |
116 | while (!signal_occurred) | |
117 | ; | |
118 | the compiler is allowed to transform this into an endless loop if the | |
119 | variable 'signal_occurred' is not declared 'volatile'. | |
120 | Additionally, recall that: | |
121 | * A signal handler should not modify errno (except if it is a handler | |
122 | for a fatal signal and ends by raising the same signal again, thus | |
123 | provoking the termination of the process). If it invokes a function | |
124 | that may clobber errno, it needs to save and restore the value of | |
125 | errno. */ | |
126 | #define _GL_ASYNC_SAFE | |
127 | ]) | |
128 | dnl Hint which direction to take regarding cross-compilation guesses: | |
129 | dnl When a user installs a program on a platform they are not intimately | |
130 | dnl familiar with, --enable-cross-guesses=conservative is the appropriate | |
131 | dnl choice. It implements the "If we don't know, assume the worst" principle. | |
132 | dnl However, when an operating system developer (on a platform which is not | |
133 | dnl yet known to gnulib) builds packages for their platform, they want to | |
134 | dnl expose, not hide, possible platform bugs; in this case, | |
135 | dnl --enable-cross-guesses=risky is the appropriate choice. | |
136 | dnl Sets the variables | |
137 | dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad), | |
138 | dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad). | |
139 | AC_ARG_ENABLE([cross-guesses], | |
140 | [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}], | |
141 | [specify policy for cross-compilation guesses])], | |
142 | [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then | |
143 | AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses]) | |
144 | enableval=conservative | |
145 | fi | |
146 | gl_cross_guesses="$enableval"], | |
147 | [gl_cross_guesses=conservative]) | |
148 | if test $gl_cross_guesses = risky; then | |
149 | gl_cross_guess_normal="guessing yes" | |
150 | gl_cross_guess_inverted="guessing no" | |
151 | else | |
152 | gl_cross_guess_normal="guessing no" | |
153 | gl_cross_guess_inverted="guessing yes" | |
154 | fi | |
82 | 155 | dnl Preparation for running test programs: |
83 | 156 | dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not |
84 | 157 | dnl to /dev/tty, so they can be redirected to log files. Such diagnostics |
213 | 286 | AC_SUBST([HAVE_FEATURES_H]) |
214 | 287 | ]) |
215 | 288 | |
216 | # m4_foreach_w | |
217 | # is a backport of autoconf-2.59c's m4_foreach_w. | |
218 | # Remove this macro when we can assume autoconf >= 2.60. | |
219 | m4_ifndef([m4_foreach_w], | |
220 | [m4_define([m4_foreach_w], | |
221 | [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) | |
222 | ||
223 | 289 | # AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) |
224 | 290 | # ---------------------------------------------------- |
225 | 291 | # Backport of autoconf-2.63b's macro. |
232 | 298 | # Modifies the value of the shell variable CC in an attempt to make $CC |
233 | 299 | # understand ISO C99 source code. |
234 | 300 | # This is like AC_PROG_CC_C99, except that |
235 | # - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, | |
236 | 301 | # - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC |
237 | 302 | # <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>, |
238 | 303 | # but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 |
319 | 384 | fi |
320 | 385 | fi |
321 | 386 | AC_SUBST([RANLIB]) |
322 | ]) | |
323 | ||
324 | # AC_PROG_MKDIR_P | |
325 | # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix | |
326 | # for interoperability with automake-1.9.6 from autoconf-2.62. | |
327 | # Remove this macro when we can assume autoconf >= 2.62 or | |
328 | # autoconf >= 2.60 && automake >= 1.10. | |
329 | # AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness. | |
330 | m4_ifndef([AC_AUTOCONF_VERSION],[ | |
331 | m4_ifdef([AC_PROG_MKDIR_P], [ | |
332 | dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed. | |
333 | m4_define([AC_PROG_MKDIR_P], | |
334 | m4_defn([AC_PROG_MKDIR_P])[ | |
335 | AC_SUBST([MKDIR_P])])], [ | |
336 | dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P. | |
337 | AC_DEFUN_ONCE([AC_PROG_MKDIR_P], | |
338 | [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake | |
339 | MKDIR_P='$(mkdir_p)' | |
340 | AC_SUBST([MKDIR_P])])]) | |
341 | 387 | ]) |
342 | 388 | |
343 | 389 | # AC_C_RESTRICT |
372 | 418 | nothing if this is not supported. Do not define if restrict is |
373 | 419 | supported directly. */ |
374 | 420 | #undef restrict |
375 | /* Work around a bug in Sun C++: it does not support _Restrict or | |
376 | __restrict__, even though the corresponding Sun C compiler ends up with | |
377 | "#define restrict _Restrict" or "#define restrict __restrict__" in the | |
378 | previous line. Perhaps some future version of Sun C++ will work with | |
379 | restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ | |
380 | #if defined __SUNPRO_CC && !defined __RESTRICT | |
421 | /* Work around a bug in older versions of Sun C++, which did not | |
422 | #define __restrict__ or support _Restrict or __restrict__ | |
423 | even though the corresponding Sun C compiler ended up with | |
424 | "#define restrict _Restrict" or "#define restrict __restrict__" | |
425 | in the previous line. This workaround can be removed once | |
426 | we assume Oracle Developer Studio 12.5 (2016) or later. */ | |
427 | #if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__ | |
381 | 428 | # define _Restrict |
382 | 429 | # define __restrict__ |
383 | 430 | #endif]) |
413 | 460 | # AS_VAR_COPY was added in autoconf 2.63b |
414 | 461 | m4_define_default([AS_VAR_COPY], |
415 | 462 | [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) |
416 | ||
417 | # AC_PROG_SED was added in autoconf 2.59b | |
418 | m4_ifndef([AC_PROG_SED], | |
419 | [AC_DEFUN([AC_PROG_SED], | |
420 | [AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED, | |
421 | [dnl ac_script should not contain more than 99 commands (for HP-UX sed), | |
422 | dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed. | |
423 | ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ | |
424 | for ac_i in 1 2 3 4 5 6 7; do | |
425 | ac_script="$ac_script$as_nl$ac_script" | |
426 | done | |
427 | echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed | |
428 | AS_UNSET([ac_script]) | |
429 | if test -z "$SED"; then | |
430 | ac_path_SED_found=false | |
431 | _AS_PATH_WALK([], [ | |
432 | for ac_prog in sed gsed; do | |
433 | for ac_exec_ext in '' $ac_executable_extensions; do | |
434 | ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" | |
435 | AS_EXECUTABLE_P(["$ac_path_SED"]) || continue | |
436 | case `"$ac_path_SED" --version 2>&1` in | |
437 | *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;; | |
438 | *) | |
439 | ac_count=0 | |
440 | _AS_ECHO_N([0123456789]) >conftest.in | |
441 | while : | |
442 | do | |
443 | cat conftest.in conftest.in >conftest.tmp | |
444 | mv conftest.tmp conftest.in | |
445 | cp conftest.in conftest.nl | |
446 | echo >> conftest.nl | |
447 | "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break | |
448 | diff conftest.out conftest.nl >/dev/null 2>&1 || break | |
449 | ac_count=`expr $ac_count + 1` | |
450 | if test $ac_count -gt ${ac_path_SED_max-0}; then | |
451 | # Best so far, but keep looking for better | |
452 | ac_cv_path_SED=$ac_path_SED | |
453 | ac_path_SED_max=$ac_count | |
454 | fi | |
455 | test $ac_count -gt 10 && break | |
456 | done | |
457 | rm -f conftest.in conftest.tmp conftest.nl conftest.out;; | |
458 | esac | |
459 | $ac_path_SED_found && break 3 | |
460 | done | |
461 | done]) | |
462 | if test -z "$ac_cv_path_SED"; then | |
463 | AC_ERROR([no acceptable sed could be found in \$PATH]) | |
464 | fi | |
465 | else | |
466 | ac_cv_path_SED=$SED | |
467 | fi | |
468 | ]) | |
469 | SED="$ac_cv_path_SED" | |
470 | AC_SUBST([SED])dnl | |
471 | rm -f conftest.sed | |
472 | ]) | |
473 | ]) |
0 | 0 | # DO NOT EDIT! GENERATED AUTOMATICALLY! |
1 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
1 | # Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
2 | 2 | # |
3 | 3 | # This file is free software; you can redistribute it and/or modify |
4 | 4 | # it under the terms of the GNU General Public License as published by |
61 | 61 | # Code from module inttypes: |
62 | 62 | # Code from module inttypes-incomplete: |
63 | 63 | # Code from module inttypes-tests: |
64 | # Code from module libc-config: | |
64 | 65 | # Code from module limits-h: |
65 | 66 | # Code from module limits-h-tests: |
66 | 67 | # Code from module maintainer-makefile: |
88 | 89 | # Code from module test-framework-sh-tests: |
89 | 90 | # Code from module unistd: |
90 | 91 | # Code from module unistd-tests: |
92 | # Code from module update-copyright: | |
93 | # Code from module update-copyright-tests: | |
91 | 94 | # Code from module useless-if-before-free: |
92 | 95 | # Code from module valgrind-tests: |
93 | 96 | # Code from module vc-list-files: |
114 | 117 | gl_COMMON |
115 | 118 | gl_source_base='gl' |
116 | 119 | gl_BYTESWAP |
120 | AC_REQUIRE([AC_C_RESTRICT]) | |
117 | 121 | gl_MD4 |
118 | 122 | AC_REQUIRE([gl_EXTERN_INLINE]) |
119 | 123 | # Autoconf 2.61a.99 and earlier don't support linking a file only |
127 | 131 | [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], |
128 | 132 | [GNUmakefile=$GNUmakefile])]) |
129 | 133 | gl_INLINE |
134 | gl___INLINE | |
130 | 135 | gl_LIMITS_H |
131 | 136 | AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], |
132 | 137 | [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) |
133 | 138 | AC_REQUIRE([AC_PROG_SED]) |
139 | AC_REQUIRE([AC_PROG_GREP]) | |
134 | 140 | gl_MULTIARCH |
135 | 141 | gt_TYPE_SSIZE_T |
136 | 142 | gl_STDALIGN_H |
198 | 204 | gl_INTTYPES_INCOMPLETE |
199 | 205 | AC_REQUIRE([gt_TYPE_WCHAR_T]) |
200 | 206 | AC_REQUIRE([gt_TYPE_WINT_T]) |
207 | abs_aux_dir=`cd "$ac_aux_dir"; pwd` | |
208 | AC_SUBST([abs_aux_dir]) | |
201 | 209 | gl_VALGRIND_TESTS |
202 | 210 | abs_aux_dir=`cd "$ac_aux_dir"; pwd` |
203 | 211 | AC_SUBST([abs_aux_dir]) |
294 | 302 | # This macro records the list of files which have been installed by |
295 | 303 | # gnulib-tool and may be removed by future gnulib-tool invocations. |
296 | 304 | AC_DEFUN([gl_FILE_LIST], [ |
305 | build-aux/update-copyright | |
297 | 306 | build-aux/useless-if-before-free |
298 | 307 | build-aux/vc-list-files |
299 | 308 | lib/arg-nonnull.h |
300 | 309 | lib/byteswap.in.h |
301 | 310 | lib/c++defs.h |
311 | lib/cdefs.h | |
302 | 312 | lib/check-version.c |
303 | 313 | lib/check-version.h |
304 | 314 | lib/des.c |
305 | 315 | lib/des.h |
316 | lib/libc-config.h | |
306 | 317 | lib/limits.in.h |
307 | 318 | lib/md4.c |
308 | 319 | lib/md4.h |
317 | 328 | lib/unistd.in.h |
318 | 329 | lib/warn-on-use.h |
319 | 330 | m4/00gnulib.m4 |
331 | m4/__inline.m4 | |
320 | 332 | m4/absolute-header.m4 |
321 | 333 | m4/autobuild.m4 |
322 | 334 | m4/byteswap.m4 |
328 | 340 | m4/inttypes-pri.m4 |
329 | 341 | m4/inttypes.m4 |
330 | 342 | m4/limits-h.m4 |
331 | m4/longlong.m4 | |
332 | 343 | m4/manywarnings-c++.m4 |
333 | 344 | m4/manywarnings.m4 |
334 | 345 | m4/md4.m4 |
349 | 360 | m4/wchar_h.m4 |
350 | 361 | m4/wchar_t.m4 |
351 | 362 | m4/wint_t.m4 |
363 | m4/zzgnulib.m4 | |
352 | 364 | tests/init.sh |
353 | 365 | tests/macros.h |
354 | 366 | tests/signature.h |
367 | 379 | tests/test-strverscmp.c |
368 | 380 | tests/test-sys_types.c |
369 | 381 | tests/test-unistd.c |
382 | tests/test-update-copyright.sh | |
370 | 383 | tests/test-vc-list-files-cvs.sh |
371 | 384 | tests/test-vc-list-files-git.sh |
372 | 385 | tests/test-verify-try.c |
0 | 0 | # include_next.m4 serial 24 |
1 | dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # inline.m4 serial 4 |
1 | dnl Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # inttypes-pri.m4 serial 7 (gettext-0.18.2) |
1 | dnl Copyright (C) 1997-2002, 2006, 2008-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 1997-2002, 2006, 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | # inttypes.m4 serial 27 | |
1 | dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
0 | # inttypes.m4 serial 29 | |
1 | dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
27 | 27 | dnl corresponding gnulib module is not in use. |
28 | 28 | gl_WARN_ON_USE_PREPARE([[#include <inttypes.h> |
29 | 29 | ]], [imaxabs imaxdiv strtoimax strtoumax]) |
30 | ||
31 | AC_REQUIRE([AC_C_RESTRICT]) | |
30 | 32 | ]) |
31 | 33 | |
32 | 34 | # Ensure that the PRI* and SCN* macros are defined appropriately. |
112 | 114 | |
113 | 115 | #if $2 |
114 | 116 | #define CONDITION ($3) |
115 | #elif HAVE_LONG_LONG_INT | |
117 | #else | |
116 | 118 | #define CONDITION ($4) |
117 | #else | |
118 | #define CONDITION 0 | |
119 | 119 | #endif |
120 | 120 | int test[CONDITION ? 1 : -1];]])], |
121 | 121 | [gl_cv_test_$1=yes], |
0 | 0 | dnl Check whether limits.h has needed features. |
1 | 1 | |
2 | dnl Copyright 2016-2018 Free Software Foundation, Inc. | |
2 | dnl Copyright 2016-2020 Free Software Foundation, Inc. | |
3 | 3 | dnl This file is free software; the Free Software Foundation |
4 | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | 5 | dnl with or without modifications, as long as this notice is preserved. |
10 | 10 | [ |
11 | 11 | gl_CHECK_NEXT_HEADERS([limits.h]) |
12 | 12 | |
13 | AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.], | |
13 | AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.], | |
14 | 14 | [gl_cv_header_limits_width], |
15 | 15 | [AC_COMPILE_IFELSE( |
16 | [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
17 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
18 | #endif | |
19 | #include <limits.h> | |
20 | int ullw = ULLONG_WIDTH;]])], | |
16 | [AC_LANG_PROGRAM( | |
17 | [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
18 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
19 | #endif | |
20 | #include <limits.h> | |
21 | long long llm = LLONG_MAX; | |
22 | int wb = WORD_BIT; | |
23 | int ullw = ULLONG_WIDTH; | |
24 | ]])], | |
21 | 25 | [gl_cv_header_limits_width=yes], |
22 | 26 | [gl_cv_header_limits_width=no])]) |
23 | 27 | if test "$gl_cv_header_limits_width" = yes; then |
0 | # longlong.m4 serial 17 | |
1 | dnl Copyright (C) 1999-2007, 2009-2018 Free Software Foundation, Inc. | |
2 | dnl This file is free software; the Free Software Foundation | |
3 | dnl gives unlimited permission to copy and/or distribute it, | |
4 | dnl with or without modifications, as long as this notice is preserved. | |
5 | ||
6 | dnl From Paul Eggert. | |
7 | ||
8 | # Define HAVE_LONG_LONG_INT if 'long long int' works. | |
9 | # This fixes a bug in Autoconf 2.61, and can be faster | |
10 | # than what's in Autoconf 2.62 through 2.68. | |
11 | ||
12 | # Note: If the type 'long long int' exists but is only 32 bits large | |
13 | # (as on some very old compilers), HAVE_LONG_LONG_INT will not be | |
14 | # defined. In this case you can treat 'long long int' like 'long int'. | |
15 | ||
16 | AC_DEFUN([AC_TYPE_LONG_LONG_INT], | |
17 | [ | |
18 | AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) | |
19 | AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], | |
20 | [ac_cv_type_long_long_int=yes | |
21 | if test "x${ac_cv_prog_cc_c99-no}" = xno; then | |
22 | ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int | |
23 | if test $ac_cv_type_long_long_int = yes; then | |
24 | dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. | |
25 | dnl If cross compiling, assume the bug is not important, since | |
26 | dnl nobody cross compiles for this platform as far as we know. | |
27 | AC_RUN_IFELSE( | |
28 | [AC_LANG_PROGRAM( | |
29 | [[@%:@include <limits.h> | |
30 | @%:@ifndef LLONG_MAX | |
31 | @%:@ define HALF \ | |
32 | (1LL << (sizeof (long long int) * CHAR_BIT - 2)) | |
33 | @%:@ define LLONG_MAX (HALF - 1 + HALF) | |
34 | @%:@endif]], | |
35 | [[long long int n = 1; | |
36 | int i; | |
37 | for (i = 0; ; i++) | |
38 | { | |
39 | long long int m = n << i; | |
40 | if (m >> i != n) | |
41 | return 1; | |
42 | if (LLONG_MAX / 2 < m) | |
43 | break; | |
44 | } | |
45 | return 0;]])], | |
46 | [], | |
47 | [ac_cv_type_long_long_int=no], | |
48 | [:]) | |
49 | fi | |
50 | fi]) | |
51 | if test $ac_cv_type_long_long_int = yes; then | |
52 | AC_DEFINE([HAVE_LONG_LONG_INT], [1], | |
53 | [Define to 1 if the system has the type 'long long int'.]) | |
54 | fi | |
55 | ]) | |
56 | ||
57 | # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. | |
58 | # This fixes a bug in Autoconf 2.61, and can be faster | |
59 | # than what's in Autoconf 2.62 through 2.68. | |
60 | ||
61 | # Note: If the type 'unsigned long long int' exists but is only 32 bits | |
62 | # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT | |
63 | # will not be defined. In this case you can treat 'unsigned long long int' | |
64 | # like 'unsigned long int'. | |
65 | ||
66 | AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], | |
67 | [ | |
68 | AC_CACHE_CHECK([for unsigned long long int], | |
69 | [ac_cv_type_unsigned_long_long_int], | |
70 | [ac_cv_type_unsigned_long_long_int=yes | |
71 | if test "x${ac_cv_prog_cc_c99-no}" = xno; then | |
72 | AC_LINK_IFELSE( | |
73 | [_AC_TYPE_LONG_LONG_SNIPPET], | |
74 | [], | |
75 | [ac_cv_type_unsigned_long_long_int=no]) | |
76 | fi]) | |
77 | if test $ac_cv_type_unsigned_long_long_int = yes; then | |
78 | AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], | |
79 | [Define to 1 if the system has the type 'unsigned long long int'.]) | |
80 | fi | |
81 | ]) | |
82 | ||
83 | # Expands to a C program that can be used to test for simultaneous support | |
84 | # of 'long long' and 'unsigned long long'. We don't want to say that | |
85 | # 'long long' is available if 'unsigned long long' is not, or vice versa, | |
86 | # because too many programs rely on the symmetry between signed and unsigned | |
87 | # integer types (excluding 'bool'). | |
88 | AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], | |
89 | [ | |
90 | AC_LANG_PROGRAM( | |
91 | [[/* For now, do not test the preprocessor; as of 2007 there are too many | |
92 | implementations with broken preprocessors. Perhaps this can | |
93 | be revisited in 2012. In the meantime, code should not expect | |
94 | #if to work with literals wider than 32 bits. */ | |
95 | /* Test literals. */ | |
96 | long long int ll = 9223372036854775807ll; | |
97 | long long int nll = -9223372036854775807LL; | |
98 | unsigned long long int ull = 18446744073709551615ULL; | |
99 | /* Test constant expressions. */ | |
100 | typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) | |
101 | ? 1 : -1)]; | |
102 | typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 | |
103 | ? 1 : -1)]; | |
104 | int i = 63;]], | |
105 | [[/* Test availability of runtime routines for shift and division. */ | |
106 | long long int llmax = 9223372036854775807ll; | |
107 | unsigned long long int ullmax = 18446744073709551615ull; | |
108 | return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | |
109 | | (llmax / ll) | (llmax % ll) | |
110 | | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | |
111 | | (ullmax / ull) | (ullmax % ull));]]) | |
112 | ]) |
0 | # manywarnings.m4 serial 16 | |
1 | dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
0 | # manywarnings.m4 serial 18 | |
1 | dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
50 | 50 | |
51 | 51 | dnl Check if -W -Werror -Wno-missing-field-initializers is supported |
52 | 52 | dnl with the current $CC $CFLAGS $CPPFLAGS. |
53 | AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) | |
54 | AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ | |
55 | gl_save_CFLAGS="$CFLAGS" | |
56 | CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" | |
57 | AC_COMPILE_IFELSE( | |
58 | [AC_LANG_PROGRAM([[]], [[]])], | |
59 | [gl_cv_cc_nomfi_supported=yes], | |
60 | [gl_cv_cc_nomfi_supported=no]) | |
61 | CFLAGS="$gl_save_CFLAGS"]) | |
62 | AC_MSG_RESULT([$gl_cv_cc_nomfi_supported]) | |
53 | AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported], | |
54 | [gl_cv_cc_nomfi_supported], | |
55 | [gl_save_CFLAGS="$CFLAGS" | |
56 | CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" | |
57 | AC_COMPILE_IFELSE( | |
58 | [AC_LANG_PROGRAM([[]], [[]])], | |
59 | [gl_cv_cc_nomfi_supported=yes], | |
60 | [gl_cv_cc_nomfi_supported=no]) | |
61 | CFLAGS="$gl_save_CFLAGS" | |
62 | ]) | |
63 | 63 | |
64 | 64 | if test "$gl_cv_cc_nomfi_supported" = yes; then |
65 | 65 | dnl Now check whether -Wno-missing-field-initializers is needed |
66 | 66 | dnl for the { 0, } construct. |
67 | AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed]) | |
68 | AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [ | |
69 | gl_save_CFLAGS="$CFLAGS" | |
70 | CFLAGS="$CFLAGS -W -Werror" | |
71 | AC_COMPILE_IFELSE( | |
72 | [AC_LANG_PROGRAM( | |
73 | [[int f (void) | |
74 | { | |
75 | typedef struct { int a; int b; } s_t; | |
76 | s_t s1 = { 0, }; | |
77 | return s1.b; | |
78 | } | |
79 | ]], | |
80 | [[]])], | |
81 | [gl_cv_cc_nomfi_needed=no], | |
82 | [gl_cv_cc_nomfi_needed=yes]) | |
83 | CFLAGS="$gl_save_CFLAGS" | |
84 | ]) | |
85 | AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) | |
67 | AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed], | |
68 | [gl_cv_cc_nomfi_needed], | |
69 | [gl_save_CFLAGS="$CFLAGS" | |
70 | CFLAGS="$CFLAGS -W -Werror" | |
71 | AC_COMPILE_IFELSE( | |
72 | [AC_LANG_PROGRAM( | |
73 | [[int f (void) | |
74 | { | |
75 | typedef struct { int a; int b; } s_t; | |
76 | s_t s1 = { 0, }; | |
77 | return s1.b; | |
78 | } | |
79 | ]], | |
80 | [[]])], | |
81 | [gl_cv_cc_nomfi_needed=no], | |
82 | [gl_cv_cc_nomfi_needed=yes]) | |
83 | CFLAGS="$gl_save_CFLAGS" | |
84 | ]) | |
86 | 85 | fi |
87 | 86 | |
88 | 87 | dnl Next, check if -Werror -Wuninitialized is useful with the |
89 | 88 | dnl user's choice of $CFLAGS; some versions of gcc warn that it |
90 | 89 | dnl has no effect if -O is not also used |
91 | AC_MSG_CHECKING([whether -Wuninitialized is supported]) | |
92 | AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ | |
93 | gl_save_CFLAGS="$CFLAGS" | |
94 | CFLAGS="$CFLAGS -Werror -Wuninitialized" | |
95 | AC_COMPILE_IFELSE( | |
96 | [AC_LANG_PROGRAM([[]], [[]])], | |
97 | [gl_cv_cc_uninitialized_supported=yes], | |
98 | [gl_cv_cc_uninitialized_supported=no]) | |
99 | CFLAGS="$gl_save_CFLAGS"]) | |
100 | AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) | |
90 | AC_CACHE_CHECK([whether -Wuninitialized is supported], | |
91 | [gl_cv_cc_uninitialized_supported], | |
92 | [gl_save_CFLAGS="$CFLAGS" | |
93 | CFLAGS="$CFLAGS -Werror -Wuninitialized" | |
94 | AC_COMPILE_IFELSE( | |
95 | [AC_LANG_PROGRAM([[]], [[]])], | |
96 | [gl_cv_cc_uninitialized_supported=yes], | |
97 | [gl_cv_cc_uninitialized_supported=no]) | |
98 | CFLAGS="$gl_save_CFLAGS" | |
99 | ]) | |
101 | 100 | |
102 | 101 | fi |
103 | 102 | |
112 | 111 | gl_manywarn_set= |
113 | 112 | for gl_manywarn_item in -fno-common \ |
114 | 113 | -W \ |
114 | -Wabsolute-value \ | |
115 | 115 | -Waddress \ |
116 | -Waddress-of-packed-member \ | |
116 | 117 | -Waggressive-loop-optimizations \ |
117 | 118 | -Wall \ |
118 | -Wattribute-alias \ | |
119 | -Wattribute-warning \ | |
119 | 120 | -Wattributes \ |
120 | 121 | -Wbad-function-cast \ |
121 | 122 | -Wbool-compare \ |
122 | 123 | -Wbool-operation \ |
123 | 124 | -Wbuiltin-declaration-mismatch \ |
124 | 125 | -Wbuiltin-macro-redefined \ |
126 | -Wcannot-profile \ | |
125 | 127 | -Wcast-align \ |
126 | 128 | -Wcast-align=strict \ |
127 | 129 | -Wcast-function-type \ |
186 | 188 | -Wmissing-field-initializers \ |
187 | 189 | -Wmissing-include-dirs \ |
188 | 190 | -Wmissing-parameter-type \ |
191 | -Wmissing-profile \ | |
189 | 192 | -Wmissing-prototypes \ |
190 | 193 | -Wmultichar \ |
191 | 194 | -Wmultistatement-macros \ |
292 | 295 | AC_MSG_RESULT([$gl_alloc_max]) |
293 | 296 | gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max" |
294 | 297 | gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" |
298 | gl_manywarn_set="$gl_manywarn_set -Wattribute-alias=2" | |
295 | 299 | gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" |
296 | 300 | gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" |
297 | 301 | gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" |
0 | 0 | # md4.m4 serial 7 |
1 | dnl Copyright (C) 2002-2006, 2008-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # multiarch.m4 serial 7 |
1 | dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # off_t.m4 serial 1 |
1 | dnl Copyright (C) 2012-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # ssize_t.m4 serial 5 (gettext-0.18.2) |
1 | dnl Copyright (C) 2001-2003, 2006, 2010-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2001-2003, 2006, 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # Check for stdalign.h that conforms to C11. |
1 | 1 | |
2 | dnl Copyright 2011-2018 Free Software Foundation, Inc. | |
2 | dnl Copyright 2011-2020 Free Software Foundation, Inc. | |
3 | 3 | dnl This file is free software; the Free Software Foundation |
4 | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | 5 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # Check for stdbool.h that conforms to C99. |
1 | 1 | |
2 | dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc. | |
2 | dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc. | |
3 | 3 | dnl This file is free software; the Free Software Foundation |
4 | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | 6 | |
7 | #serial 7 | |
7 | #serial 8 | |
8 | 8 | |
9 | 9 | # Prepare for substituting <stdbool.h> if it is not supported. |
10 | 10 | |
11 | 11 | AC_DEFUN([AM_STDBOOL_H], |
12 | 12 | [ |
13 | 13 | AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) |
14 | AC_REQUIRE([AC_CANONICAL_HOST]) | |
14 | 15 | |
15 | # Define two additional variables used in the Makefile substitution. | |
16 | ||
16 | dnl On some platforms, <stdbool.h> does not exist or does not conform to C99. | |
17 | dnl On Solaris 10 with CC=cc CXX=CC, <stdbool.h> exists but is not usable | |
18 | dnl in C++ mode (and no <cstdbool> exists). In this case, we use our | |
19 | dnl replacement, also in C mode (for binary compatibility between C and C++). | |
17 | 20 | if test "$ac_cv_header_stdbool_h" = yes; then |
18 | STDBOOL_H='' | |
21 | case "$host_os" in | |
22 | solaris*) | |
23 | if test -z "$GCC"; then | |
24 | STDBOOL_H='stdbool.h' | |
25 | else | |
26 | STDBOOL_H='' | |
27 | fi | |
28 | ;; | |
29 | *) | |
30 | STDBOOL_H='' | |
31 | ;; | |
32 | esac | |
19 | 33 | else |
20 | 34 | STDBOOL_H='stdbool.h' |
21 | 35 | fi |
0 | 0 | dnl A placeholder for <stddef.h>, for platforms that have issues. |
1 | # stddef_h.m4 serial 5 | |
2 | dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
1 | # stddef_h.m4 serial 6 | |
2 | dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
3 | 3 | dnl This file is free software; the Free Software Foundation |
4 | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | 5 | dnl with or without modifications, as long as this notice is preserved. |
9 | 9 | AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) |
10 | 10 | AC_REQUIRE([gt_TYPE_WCHAR_T]) |
11 | 11 | STDDEF_H= |
12 | AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h], | |
13 | [[#include <stddef.h> | |
14 | ]]) | |
12 | ||
13 | dnl Test whether the type max_align_t exists and whether its alignment | |
14 | dnl "is as great as is supported by the implementation in all contexts". | |
15 | AC_CACHE_CHECK([for good max_align_t], | |
16 | [gl_cv_type_max_align_t], | |
17 | [AC_COMPILE_IFELSE( | |
18 | [AC_LANG_PROGRAM( | |
19 | [[#include <stddef.h> | |
20 | unsigned int s = sizeof (max_align_t); | |
21 | #if defined __GNUC__ || defined __IBM__ALIGNOF__ | |
22 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; | |
23 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
24 | #endif | |
25 | ]])], | |
26 | [gl_cv_type_max_align_t=yes], | |
27 | [gl_cv_type_max_align_t=no]) | |
28 | ]) | |
29 | if test $gl_cv_type_max_align_t = no; then | |
30 | HAVE_MAX_ALIGN_T=0 | |
31 | STDDEF_H=stddef.h | |
32 | fi | |
33 | ||
15 | 34 | if test $gt_cv_c_wchar_t = no; then |
16 | 35 | HAVE_WCHAR_T=0 |
17 | 36 | STDDEF_H=stddef.h |
18 | 37 | fi |
38 | ||
19 | 39 | AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], |
20 | 40 | [gl_cv_decl_null_works], |
21 | 41 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h> |
27 | 47 | REPLACE_NULL=1 |
28 | 48 | STDDEF_H=stddef.h |
29 | 49 | fi |
50 | ||
30 | 51 | AC_SUBST([STDDEF_H]) |
31 | 52 | AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) |
32 | 53 | if test -n "$STDDEF_H"; then |
0 | # stdint.m4 serial 52 | |
1 | dnl Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
0 | # stdint.m4 serial 54 | |
1 | dnl Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
6 | 6 | dnl From Paul Eggert and Bruno Haible. |
7 | 7 | dnl Test whether <stdint.h> is supported or must be substituted. |
8 | 8 | |
9 | AC_PREREQ([2.61]) | |
10 | ||
9 | 11 | AC_DEFUN_ONCE([gl_STDINT_H], |
10 | 12 | [ |
11 | 13 | AC_PREREQ([2.59])dnl |
14 | 16 | AC_REQUIRE([gl_LIMITS_H]) |
15 | 17 | AC_REQUIRE([gt_TYPE_WINT_T]) |
16 | 18 | |
17 | dnl Check for long long int and unsigned long long int. | |
18 | AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) | |
19 | if test $ac_cv_type_long_long_int = yes; then | |
20 | HAVE_LONG_LONG_INT=1 | |
21 | else | |
22 | HAVE_LONG_LONG_INT=0 | |
23 | fi | |
24 | AC_SUBST([HAVE_LONG_LONG_INT]) | |
25 | AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) | |
26 | if test $ac_cv_type_unsigned_long_long_int = yes; then | |
27 | HAVE_UNSIGNED_LONG_LONG_INT=1 | |
28 | else | |
29 | HAVE_UNSIGNED_LONG_LONG_INT=0 | |
30 | fi | |
31 | AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) | |
19 | dnl For backward compatibility. Some packages may still be testing these | |
20 | dnl macros. | |
21 | AC_DEFINE([HAVE_LONG_LONG_INT], [1], | |
22 | [Define to 1 if the system has the type 'long long int'.]) | |
23 | AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], | |
24 | [Define to 1 if the system has the type 'unsigned long long int'.]) | |
32 | 25 | |
33 | 26 | dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does. |
34 | 27 | AC_CHECK_HEADERS_ONCE([wchar.h]) |
539 | 532 | BITSIZEOF_WINT_T=32 |
540 | 533 | fi |
541 | 534 | ]) |
542 | ||
543 | dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. | |
544 | dnl Remove this when we can assume autoconf >= 2.61. | |
545 | m4_ifdef([AC_COMPUTE_INT], [], [ | |
546 | AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) | |
547 | ]) |
0 | 0 | # Configure a GNU-like replacement for <string.h>. |
1 | 1 | |
2 | # Copyright (C) 2007-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2007-2020 Free Software Foundation, Inc. | |
3 | 3 | # This file is free software; the Free Software Foundation |
4 | 4 | # gives unlimited permission to copy and/or distribute it, |
5 | 5 | # with or without modifications, as long as this notice is preserved. |
6 | 6 | |
7 | # serial 22 | |
7 | # serial 23 | |
8 | 8 | |
9 | 9 | # Written by Paul Eggert. |
10 | 10 | |
17 | 17 | |
18 | 18 | AC_DEFUN([gl_HEADER_STRING_H_BODY], |
19 | 19 | [ |
20 | AC_REQUIRE([AC_C_RESTRICT]) | |
21 | 20 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) |
22 | 21 | gl_NEXT_HEADERS([string.h]) |
23 | 22 | |
29 | 28 | [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul |
30 | 29 | strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r |
31 | 30 | strerror_r strsignal strverscmp]) |
31 | ||
32 | AC_REQUIRE([AC_C_RESTRICT]) | |
32 | 33 | ]) |
33 | 34 | |
34 | 35 | AC_DEFUN([gl_STRING_MODULE_INDICATOR], |
0 | 0 | # strverscmp.m4 serial 8 |
1 | dnl Copyright (C) 2002, 2005-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2002, 2005-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # sys_types_h.m4 serial 9 |
1 | dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | # unistd_h.m4 serial 74 | |
1 | dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
0 | # unistd_h.m4 serial 78 | |
1 | dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
40 | 40 | # include <io.h> |
41 | 41 | # endif |
42 | 42 | #endif |
43 | ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat | |
44 | fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups | |
45 | gethostname getlogin getlogin_r getpagesize getpass | |
43 | ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir | |
44 | fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize | |
45 | getgroups gethostname getlogin getlogin_r getpagesize getpass | |
46 | 46 | getusershell setusershell endusershell |
47 | 47 | group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite |
48 | 48 | readlink readlinkat rmdir sethostname sleep symlink symlinkat |
49 | 49 | truncate ttyname_r unlink unlinkat usleep]) |
50 | ||
51 | AC_REQUIRE([AC_C_RESTRICT]) | |
50 | 52 | ]) |
51 | 53 | |
52 | 54 | AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], |
60 | 62 | |
61 | 63 | AC_DEFUN([gl_UNISTD_H_DEFAULTS], |
62 | 64 | [ |
65 | GNULIB_ACCESS=0; AC_SUBST([GNULIB_ACCESS]) | |
63 | 66 | GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) |
64 | 67 | GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) |
65 | 68 | GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) |
69 | GNULIB_COPY_FILE_RANGE=0; AC_SUBST([GNULIB_COPY_FILE_RANGE]) | |
66 | 70 | GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) |
67 | 71 | GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) |
68 | 72 | GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) |
81 | 85 | GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) |
82 | 86 | GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) |
83 | 87 | GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) |
88 | GNULIB_GETOPT_POSIX=0; AC_SUBST([GNULIB_GETOPT_POSIX]) | |
84 | 89 | GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) |
85 | 90 | GNULIB_GETPASS=0; AC_SUBST([GNULIB_GETPASS]) |
86 | 91 | GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) |
112 | 117 | GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) |
113 | 118 | dnl Assume proper GNU behavior unless another module says otherwise. |
114 | 119 | HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) |
120 | HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE]) | |
115 | 121 | HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) |
116 | 122 | HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) |
117 | 123 | HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) |
156 | 162 | HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) |
157 | 163 | HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) |
158 | 164 | HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) |
165 | REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS]) | |
159 | 166 | REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) |
160 | 167 | REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) |
161 | 168 | REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) |
0 | 0 | # valgrind-tests.m4 serial 4 |
1 | dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # warn-on-use.m4 serial 6 |
1 | dnl Copyright (C) 2010-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # warnings.m4 serial 14 |
1 | dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. |
1 | 1 | |
2 | dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. | |
2 | dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. | |
3 | 3 | dnl This file is free software; the Free Software Foundation |
4 | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | 6 | |
7 | 7 | dnl Written by Eric Blake. |
8 | 8 | |
9 | # wchar_h.m4 serial 43 | |
9 | # wchar_h.m4 serial 45 | |
10 | 10 | |
11 | 11 | AC_DEFUN([gl_WCHAR_H], |
12 | 12 | [ |
56 | 56 | wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr |
57 | 57 | wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime |
58 | 58 | ]) |
59 | ||
60 | AC_REQUIRE([AC_C_RESTRICT]) | |
59 | 61 | ]) |
60 | 62 | |
61 | 63 | dnl Check whether <wchar.h> is usable at all. |
236 | 238 | REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) |
237 | 239 | REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) |
238 | 240 | REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME]) |
239 | ]) | |
241 | REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK]) | |
242 | ]) |
0 | 0 | # wchar_t.m4 serial 4 (gettext-0.18.2) |
1 | dnl Copyright (C) 2002-2003, 2008-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2002-2003, 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | 0 | # wint_t.m4 serial 7 |
1 | dnl Copyright (C) 2003, 2007-2018 Free Software Foundation, Inc. | |
1 | dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc. | |
2 | 2 | dnl This file is free software; the Free Software Foundation |
3 | 3 | dnl gives unlimited permission to copy and/or distribute it, |
4 | 4 | dnl with or without modifications, as long as this notice is preserved. |
0 | # zzgnulib.m4 serial 1 | |
1 | dnl Copyright (C) 2020 Free Software Foundation, Inc. | |
2 | dnl This file is free software; the Free Software Foundation | |
3 | dnl gives unlimited permission to copy and/or distribute it, | |
4 | dnl with or without modifications, as long as this notice is preserved. | |
5 | ||
6 | dnl This file must be named something that sorts after all other | |
7 | dnl package- or gnulib-provided .m4 files - at least for those packages | |
8 | dnl that redefine AC_PROG_CC. | |
9 | ||
10 | dnl Redefine AC_PROG_CC so that it ends with invocations of gl_COMPILER_CLANG | |
11 | dnl and gl_COMPILER_PREPARE_CHECK_DECL. | |
12 | m4_define([AC_PROG_CC], | |
13 | m4_defn([AC_PROG_CC])[ | |
14 | gl_COMPILER_CLANG | |
15 | gl_COMPILER_PREPARE_CHECK_DECL | |
16 | ]) | |
17 | ||
18 | # gl_ZZGNULIB | |
19 | # ----------- | |
20 | # Witness macro that this file has been included. Needed to force | |
21 | # Automake to include this file after all other gnulib .m4 files. | |
22 | AC_DEFUN([gl_ZZGNULIB]) |
0 | 0 | /* Functions to compute MD4 message digest of files or memory blocks. |
1 | 1 | according to the definition of MD4 in RFC 1320 from April 1992. |
2 | Copyright (C) 1995-1997, 1999-2003, 2005-2006, 2008-2018 Free Software | |
2 | Copyright (C) 1995-1997, 1999-2003, 2005-2006, 2008-2020 Free Software | |
3 | 3 | Foundation, Inc. |
4 | 4 | |
5 | 5 | This program is free software; you can redistribute it and/or modify it |
0 | 0 | /* Declarations of functions and data types used for MD4 sum |
1 | 1 | library functions. |
2 | Copyright (C) 2000-2001, 2003, 2005, 2008-2018 Free Software Foundation, | |
2 | Copyright (C) 2000-2001, 2003, 2005, 2008-2020 Free Software Foundation, | |
3 | 3 | Inc. |
4 | 4 | |
5 | 5 | This program is free software; you can redistribute it and/or modify it |
62 | 62 | in first 16 bytes following RESBUF. The result is always in little |
63 | 63 | endian byte order, so that a byte-wise output yields to the wanted |
64 | 64 | ASCII representation of the message digest. */ |
65 | extern void *md4_finish_ctx (struct md4_ctx *ctx, void *resbuf); | |
65 | extern void *md4_finish_ctx (struct md4_ctx *ctx, void *restrict resbuf); | |
66 | 66 | |
67 | 67 | |
68 | 68 | /* Put result from CTX in first 16 bytes following RESBUF. The result is |
69 | 69 | always in little endian byte order, so that a byte-wise output yields |
70 | 70 | to the wanted ASCII representation of the message digest. */ |
71 | extern void *md4_read_ctx (const struct md4_ctx *ctx, void *resbuf); | |
71 | extern void *md4_read_ctx (const struct md4_ctx *ctx, void *restrict resbuf); | |
72 | 72 | |
73 | 73 | |
74 | 74 | /* Compute MD4 message digest for bytes read from STREAM. The |
80 | 80 | result is always in little endian byte order, so that a byte-wise |
81 | 81 | output yields to the wanted ASCII representation of the message |
82 | 82 | digest. */ |
83 | extern void *md4_buffer (const char *buffer, size_t len, void *resblock); | |
83 | extern void *md4_buffer (const char *buffer, size_t len, | |
84 | void *restrict resblock); | |
84 | 85 | |
85 | 86 | # ifdef __cplusplus |
86 | 87 | } |
0 | 0 | /* A substitute for ISO C11 <stdalign.h>. |
1 | 1 | |
2 | Copyright 2011-2018 Free Software Foundation, Inc. | |
2 | Copyright 2011-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU Lesser General Public License as published by |
101 | 101 | # define _Alignas(a) alignas (a) |
102 | 102 | # elif ((defined __APPLE__ && defined __MACH__ \ |
103 | 103 | ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ |
104 | : __GNUC__) \ | |
104 | : __GNUC__ && !defined __ibmxl__) \ | |
105 | 105 | || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ |
106 | 106 | || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__) |
107 | 107 | # define _Alignas(a) __attribute__ ((__aligned__ (a))) |
0 | /* Copyright (C) 2001-2003, 2006-2018 Free Software Foundation, Inc. | |
0 | /* Copyright (C) 2001-2003, 2006-2020 Free Software Foundation, Inc. | |
1 | 1 | Written by Bruno Haible <haible@clisp.cons.org>, 2001. |
2 | 2 | |
3 | 3 | This program is free software; you can redistribute it and/or modify |
0 | 0 | /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. |
1 | 1 | |
2 | Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU Lesser General Public License as published by |
18 | 18 | |
19 | 19 | /* |
20 | 20 | * POSIX 2008 <stddef.h> for platforms that have issues. |
21 | * <http://www.opengroup.org/susv3xbd/stddef.h.html> | |
21 | * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html> | |
22 | 22 | */ |
23 | 23 | |
24 | 24 | #if __GNUC__ >= 3 |
82 | 82 | |
83 | 83 | /* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is |
84 | 84 | a hack in case the configure-time test was done with g++ even though |
85 | we are currently compiling with gcc. */ | |
86 | #if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) | |
87 | # if !GNULIB_defined_max_align_t | |
85 | we are currently compiling with gcc. | |
86 | On MSVC, max_align_t is defined only in C++ mode, after <cstddef> was | |
87 | included. Its definition is good since it has an alignment of 8 (on x86 | |
88 | and x86_64). */ | |
89 | #if defined _MSC_VER && defined __cplusplus | |
90 | # include <cstddef> | |
91 | #else | |
92 | # if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) | |
93 | # if !GNULIB_defined_max_align_t | |
88 | 94 | /* On the x86, the maximum storage alignment of double, long, etc. is 4, |
89 | 95 | but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, |
90 | 96 | and the C11 standard allows this. Work around this problem by |
91 | 97 | using __alignof__ (which returns 8 for double) rather than _Alignof |
92 | 98 | (which returns 4), and align each union member accordingly. */ |
93 | # ifdef __GNUC__ | |
94 | # define _GL_STDDEF_ALIGNAS(type) \ | |
95 | __attribute__ ((__aligned__ (__alignof__ (type)))) | |
96 | # else | |
97 | # define _GL_STDDEF_ALIGNAS(type) /* */ | |
98 | # endif | |
99 | # ifdef __GNUC__ | |
100 | # define _GL_STDDEF_ALIGNAS(type) \ | |
101 | __attribute__ ((__aligned__ (__alignof__ (type)))) | |
102 | # else | |
103 | # define _GL_STDDEF_ALIGNAS(type) /* */ | |
104 | # endif | |
99 | 105 | typedef union |
100 | 106 | { |
101 | 107 | char *__p _GL_STDDEF_ALIGNAS (char *); |
103 | 109 | long double __ld _GL_STDDEF_ALIGNAS (long double); |
104 | 110 | long int __i _GL_STDDEF_ALIGNAS (long int); |
105 | 111 | } rpl_max_align_t; |
106 | # define max_align_t rpl_max_align_t | |
107 | # define GNULIB_defined_max_align_t 1 | |
112 | # define max_align_t rpl_max_align_t | |
113 | # define GNULIB_defined_max_align_t 1 | |
114 | # endif | |
108 | 115 | # endif |
109 | 116 | #endif |
110 | 117 |
0 | /* Copyright (C) 2001-2002, 2004-2018 Free Software Foundation, Inc. | |
0 | /* Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc. | |
1 | 1 | Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. |
2 | 2 | This file is part of gnulib. |
3 | 3 | |
16 | 16 | |
17 | 17 | /* |
18 | 18 | * ISO C 99 <stdint.h> for platforms that lack it. |
19 | * <http://www.opengroup.org/susv3xbd/stdint.h.html> | |
19 | * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html> | |
20 | 20 | */ |
21 | 21 | |
22 | 22 | #ifndef _@GUARD_PREFIX@_STDINT_H |
187 | 187 | typedef __int64 gl_int64_t; |
188 | 188 | # define int64_t gl_int64_t |
189 | 189 | # define GL_INT64_T |
190 | # elif @HAVE_LONG_LONG_INT@ | |
190 | # else | |
191 | 191 | # undef int64_t |
192 | 192 | typedef long long int gl_int64_t; |
193 | 193 | # define int64_t gl_int64_t |
208 | 208 | typedef unsigned __int64 gl_uint64_t; |
209 | 209 | # define uint64_t gl_uint64_t |
210 | 210 | # define GL_UINT64_T |
211 | # elif @HAVE_UNSIGNED_LONG_LONG_INT@ | |
211 | # else | |
212 | 212 | # undef uint64_t |
213 | 213 | typedef unsigned long long int gl_uint64_t; |
214 | 214 | # define uint64_t gl_uint64_t |
298 | 298 | |
299 | 299 | /* 7.18.1.4. Integer types capable of holding object pointers */ |
300 | 300 | |
301 | /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own | |
301 | /* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own | |
302 | 302 | definitions of intptr_t and uintptr_t (which use int and unsigned) |
303 | to avoid clashes with declarations of system functions like sbrk. */ | |
304 | # ifndef _INTPTR_T_DECLARED | |
305 | # undef intptr_t | |
306 | # undef uintptr_t | |
303 | to avoid clashes with declarations of system functions like sbrk. | |
304 | Similarly, mingw 5.22 <crtdefs.h> defines _INTPTR_T_DEFINED and | |
305 | _UINTPTR_T_DEFINED and needs its own definitions of intptr_t and | |
306 | uintptr_t to avoid conflicting declarations of system functions like | |
307 | _findclose in <io.h>. */ | |
308 | # if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \ | |
309 | || (defined __MINGW32__ && defined _INTPTR_T_DEFINED && defined _UINTPTR_T_DEFINED)) | |
310 | # undef intptr_t | |
311 | # undef uintptr_t | |
312 | # ifdef _WIN64 | |
313 | typedef long long int gl_intptr_t; | |
314 | typedef unsigned long long int gl_uintptr_t; | |
315 | # else | |
307 | 316 | typedef long int gl_intptr_t; |
308 | 317 | typedef unsigned long int gl_uintptr_t; |
309 | # define intptr_t gl_intptr_t | |
310 | # define uintptr_t gl_uintptr_t | |
318 | # endif | |
319 | # define intptr_t gl_intptr_t | |
320 | # define uintptr_t gl_uintptr_t | |
311 | 321 | # endif |
312 | 322 | |
313 | 323 | /* 7.18.1.5. Greatest-width integer types */ |
322 | 332 | # ifndef INTMAX_MAX |
323 | 333 | # undef INTMAX_C |
324 | 334 | # undef intmax_t |
325 | # if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 | |
335 | # if LONG_MAX >> 30 == 1 | |
326 | 336 | typedef long long int gl_intmax_t; |
327 | 337 | # define intmax_t gl_intmax_t |
328 | 338 | # elif defined GL_INT64_T |
336 | 346 | # ifndef UINTMAX_MAX |
337 | 347 | # undef UINTMAX_C |
338 | 348 | # undef uintmax_t |
339 | # if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 | |
349 | # if ULONG_MAX >> 31 == 1 | |
340 | 350 | typedef unsigned long long int gl_uintmax_t; |
341 | 351 | # define uintmax_t gl_uintmax_t |
342 | 352 | # elif defined GL_UINT64_T |
484 | 494 | # undef INTPTR_MIN |
485 | 495 | # undef INTPTR_MAX |
486 | 496 | # undef UINTPTR_MAX |
487 | # define INTPTR_MIN LONG_MIN | |
488 | # define INTPTR_MAX LONG_MAX | |
489 | # define UINTPTR_MAX ULONG_MAX | |
497 | # ifdef _WIN64 | |
498 | # define INTPTR_MIN LLONG_MIN | |
499 | # define INTPTR_MAX LLONG_MAX | |
500 | # define UINTPTR_MAX ULLONG_MAX | |
501 | # else | |
502 | # define INTPTR_MIN LONG_MIN | |
503 | # define INTPTR_MAX LONG_MAX | |
504 | # define UINTPTR_MAX ULONG_MAX | |
505 | # endif | |
490 | 506 | |
491 | 507 | /* 7.18.2.5. Limits of greatest-width integer types */ |
492 | 508 | |
585 | 601 | _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) |
586 | 602 | |
587 | 603 | /* wint_t limits */ |
588 | # undef WINT_MIN | |
589 | # undef WINT_MAX | |
590 | # if @HAVE_SIGNED_WINT_T@ | |
591 | # define WINT_MIN \ | |
592 | _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | |
593 | # else | |
594 | # define WINT_MIN \ | |
595 | _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | |
596 | # endif | |
597 | # define WINT_MAX \ | |
598 | _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | |
604 | /* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not | |
605 | accurate, therefore use the definitions from above. */ | |
606 | # if !@GNULIB_OVERRIDES_WINT_T@ | |
607 | # undef WINT_MIN | |
608 | # undef WINT_MAX | |
609 | # if @HAVE_SIGNED_WINT_T@ | |
610 | # define WINT_MIN \ | |
611 | _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | |
612 | # else | |
613 | # define WINT_MIN \ | |
614 | _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | |
615 | # endif | |
616 | # define WINT_MAX \ | |
617 | _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | |
618 | # endif | |
599 | 619 | |
600 | 620 | /* 7.18.4. Macros for integer constants */ |
601 | 621 | |
626 | 646 | # define INT64_C(x) x##L |
627 | 647 | # elif defined _MSC_VER |
628 | 648 | # define INT64_C(x) x##i64 |
629 | # elif @HAVE_LONG_LONG_INT@ | |
649 | # else | |
630 | 650 | # define INT64_C(x) x##LL |
631 | 651 | # endif |
632 | 652 | # if ULONG_MAX >> 31 >> 31 >> 1 == 1 |
633 | 653 | # define UINT64_C(x) x##UL |
634 | 654 | # elif defined _MSC_VER |
635 | 655 | # define UINT64_C(x) x##ui64 |
636 | # elif @HAVE_UNSIGNED_LONG_LONG_INT@ | |
656 | # else | |
637 | 657 | # define UINT64_C(x) x##ULL |
638 | 658 | # endif |
639 | 659 | |
640 | 660 | /* 7.18.4.2. Macros for greatest-width integer constants */ |
641 | 661 | |
642 | 662 | # ifndef INTMAX_C |
643 | # if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 | |
663 | # if LONG_MAX >> 30 == 1 | |
644 | 664 | # define INTMAX_C(x) x##LL |
645 | 665 | # elif defined GL_INT64_T |
646 | 666 | # define INTMAX_C(x) INT64_C(x) |
650 | 670 | # endif |
651 | 671 | |
652 | 672 | # ifndef UINTMAX_C |
653 | # if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 | |
673 | # if ULONG_MAX >> 31 == 1 | |
654 | 674 | # define UINTMAX_C(x) x##ULL |
655 | 675 | # elif defined GL_UINT64_T |
656 | 676 | # define UINTMAX_C(x) UINT64_C(x) |
0 | 0 | /* A GNU-like <string.h>. |
1 | 1 | |
2 | Copyright (C) 1995-1996, 2001-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU Lesser General Public License as published by |
148 | 148 | _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n)); |
149 | 149 | _GL_CXXALIASWARN1 (memchr, void const *, |
150 | 150 | (void const *__s, int __c, size_t __n)); |
151 | # else | |
151 | # elif __GLIBC__ >= 2 | |
152 | 152 | _GL_CXXALIASWARN (memchr); |
153 | 153 | # endif |
154 | 154 | #elif defined GNULIB_POSIXCHECK |
410 | 410 | # undef strncat |
411 | 411 | # define strncat rpl_strncat |
412 | 412 | # endif |
413 | _GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n) | |
414 | _GL_ARG_NONNULL ((1, 2))); | |
415 | _GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n)); | |
416 | # else | |
417 | _GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n)); | |
418 | # endif | |
413 | _GL_FUNCDECL_RPL (strncat, char *, | |
414 | (char *restrict dest, const char *restrict src, size_t n) | |
415 | _GL_ARG_NONNULL ((1, 2))); | |
416 | _GL_CXXALIAS_RPL (strncat, char *, | |
417 | (char *restrict dest, const char *restrict src, size_t n)); | |
418 | # else | |
419 | _GL_CXXALIAS_SYS (strncat, char *, | |
420 | (char *restrict dest, const char *restrict src, size_t n)); | |
421 | # endif | |
422 | # if __GLIBC__ >= 2 | |
419 | 423 | _GL_CXXALIASWARN (strncat); |
424 | # endif | |
420 | 425 | #elif defined GNULIB_POSIXCHECK |
421 | 426 | # undef strncat |
422 | 427 | # if HAVE_RAW_DECL_STRNCAT |
511 | 516 | _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept)); |
512 | 517 | _GL_CXXALIASWARN1 (strpbrk, char const *, |
513 | 518 | (char const *__s, char const *__accept)); |
514 | # else | |
519 | # elif __GLIBC__ >= 2 | |
515 | 520 | _GL_CXXALIASWARN (strpbrk); |
516 | 521 | # endif |
517 | 522 | # if defined GNULIB_POSIXCHECK |
613 | 618 | _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle)); |
614 | 619 | _GL_CXXALIASWARN1 (strstr, const char *, |
615 | 620 | (const char *haystack, const char *needle)); |
616 | # else | |
621 | # elif __GLIBC__ >= 2 | |
617 | 622 | _GL_CXXALIASWARN (strstr); |
618 | 623 | # endif |
619 | 624 | #elif defined GNULIB_POSIXCHECK |
692 | 697 | This is a variant of strtok() that is multithread-safe. |
693 | 698 | |
694 | 699 | For the POSIX documentation for this function, see: |
695 | http://www.opengroup.org/susv3xsh/strtok.html | |
700 | https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok.html | |
696 | 701 | |
697 | 702 | Caveat: It modifies the original string. |
698 | 703 | Caveat: These functions cannot be used on constant strings. |
963 | 968 | Caveat: The identity of the delimiting character is lost. |
964 | 969 | |
965 | 970 | See also mbssep(). */ |
966 | _GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr) | |
971 | _GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim, | |
972 | char **save_ptr) | |
967 | 973 | _GL_ARG_NONNULL ((2, 3)); |
968 | 974 | #endif |
969 | 975 | |
979 | 985 | # else |
980 | 986 | _GL_CXXALIAS_SYS (strerror, char *, (int)); |
981 | 987 | # endif |
988 | # if __GLIBC__ >= 2 | |
982 | 989 | _GL_CXXALIASWARN (strerror); |
990 | # endif | |
983 | 991 | #elif defined GNULIB_POSIXCHECK |
984 | 992 | # undef strerror |
985 | 993 | /* Assume strerror is always declared. */ |
0 | 0 | /* Compare strings while treating digits characters numerically. |
1 | Copyright (C) 1997-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
2 | 2 | This file is part of the GNU C Library. |
3 | 3 | Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997. |
4 | 4 | |
16 | 16 | License along with the GNU C Library; if not, see |
17 | 17 | <https://www.gnu.org/licenses/>. */ |
18 | 18 | |
19 | #if !_LIBC | |
20 | # include <config.h> | |
19 | #ifndef _LIBC | |
20 | # include <libc-config.h> | |
21 | # define __strverscmp strverscmp | |
21 | 22 | #endif |
22 | 23 | |
24 | #include <stdint.h> | |
23 | 25 | #include <string.h> |
24 | 26 | #include <ctype.h> |
25 | 27 | |
34 | 36 | #define CMP 2 |
35 | 37 | #define LEN 3 |
36 | 38 | |
37 | #ifndef weak_alias | |
38 | # define __strverscmp strverscmp | |
39 | #endif | |
40 | 39 | |
41 | 40 | /* Compare S1 and S2 as strings holding indices/version numbers, |
42 | 41 | returning less than, equal to or greater than zero if S1 is less than, |
48 | 47 | { |
49 | 48 | const unsigned char *p1 = (const unsigned char *) s1; |
50 | 49 | const unsigned char *p2 = (const unsigned char *) s2; |
51 | unsigned char c1, c2; | |
52 | int state; | |
53 | int diff; | |
54 | 50 | |
55 | 51 | /* Symbol(s) 0 [1-9] others |
56 | 52 | Transition (10) 0 (01) d (00) x */ |
57 | static const unsigned char next_state[] = | |
53 | static const uint_least8_t next_state[] = | |
58 | 54 | { |
59 | 55 | /* state x d 0 */ |
60 | 56 | /* S_N */ S_N, S_I, S_Z, |
63 | 59 | /* S_Z */ S_N, S_F, S_Z |
64 | 60 | }; |
65 | 61 | |
66 | static const signed char result_type[] = | |
62 | static const int_least8_t result_type[] = | |
67 | 63 | { |
68 | 64 | /* state x/x x/d x/0 d/x d/d d/0 0/x 0/d 0/0 */ |
69 | 65 | |
76 | 72 | if (p1 == p2) |
77 | 73 | return 0; |
78 | 74 | |
79 | c1 = *p1++; | |
80 | c2 = *p2++; | |
75 | unsigned char c1 = *p1++; | |
76 | unsigned char c2 = *p2++; | |
81 | 77 | /* Hint: '0' is a digit too. */ |
82 | state = S_N + ((c1 == '0') + (isdigit (c1) != 0)); | |
78 | int state = S_N + ((c1 == '0') + (isdigit (c1) != 0)); | |
83 | 79 | |
80 | int diff; | |
84 | 81 | while ((diff = c1 - c2) == 0) |
85 | 82 | { |
86 | 83 | if (c1 == '\0') |
87 | return diff; | |
84 | return diff; | |
88 | 85 | |
89 | 86 | state = next_state[state]; |
90 | 87 | c1 = *p1++; |
95 | 92 | state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))]; |
96 | 93 | |
97 | 94 | switch (state) |
98 | { | |
95 | { | |
99 | 96 | case CMP: |
100 | 97 | return diff; |
101 | 98 | |
102 | 99 | case LEN: |
103 | 100 | while (isdigit (*p1++)) |
104 | if (!isdigit (*p2++)) | |
105 | return 1; | |
101 | if (!isdigit (*p2++)) | |
102 | return 1; | |
106 | 103 | |
107 | 104 | return isdigit (*p2) ? -1 : diff; |
108 | 105 | |
109 | 106 | default: |
110 | 107 | return state; |
111 | } | |
108 | } | |
112 | 109 | } |
113 | #ifdef weak_alias | |
114 | 110 | libc_hidden_def (__strverscmp) |
115 | 111 | weak_alias (__strverscmp, strverscmp) |
116 | #endif |
0 | 0 | /* Provide a more complete sys/types.h. |
1 | 1 | |
2 | Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU Lesser General Public License as published by |
0 | 0 | ## DO NOT EDIT! GENERATED AUTOMATICALLY! |
1 | 1 | ## Process this file with automake to produce Makefile.in. |
2 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
3 | 3 | # |
4 | 4 | # This file is free software; you can redistribute it and/or modify |
5 | 5 | # it under the terms of the GNU General Public License as published by |
21 | 21 | # |
22 | 22 | # Generated by gnulib-tool. |
23 | 23 | |
24 | AUTOMAKE_OPTIONS = 1.9.6 foreign | |
24 | AUTOMAKE_OPTIONS = 1.11 foreign | |
25 | 25 | |
26 | 26 | SUBDIRS = . |
27 | 27 | TESTS = |
113 | 113 | -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ |
114 | 114 | -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ |
115 | 115 | -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ |
116 | -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ | |
117 | -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ | |
118 | 116 | -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ |
119 | 117 | -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ |
120 | 118 | -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ |
266 | 264 | EXTRA_DIST += test-unistd.c |
267 | 265 | |
268 | 266 | ## end gnulib module unistd-tests |
267 | ||
268 | ## begin gnulib module update-copyright-tests | |
269 | ||
270 | TESTS += test-update-copyright.sh | |
271 | TESTS_ENVIRONMENT += abs_aux_dir='$(abs_aux_dir)' | |
272 | EXTRA_DIST += test-update-copyright.sh | |
273 | ||
274 | ## end gnulib module update-copyright-tests | |
269 | 275 | |
270 | 276 | ## begin gnulib module vc-list-files-tests |
271 | 277 | |
415 | 421 | -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ |
416 | 422 | -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ |
417 | 423 | -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \ |
424 | -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \ | |
418 | 425 | -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ |
419 | 426 | -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ |
420 | 427 | -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ |
0 | # Makefile.in generated by automake 1.15 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2014 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
13 | 13 | |
14 | 14 | @SET_MAKE@ |
15 | 15 | |
16 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
16 | # Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
17 | 17 | # |
18 | 18 | # This file is free software; you can redistribute it and/or modify |
19 | 19 | # it under the terms of the GNU General Public License as published by |
117 | 117 | test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \ |
118 | 118 | test-stdint$(EXEEXT) test-string$(EXEEXT) \ |
119 | 119 | test-strverscmp$(EXEEXT) test-sys_types$(EXEEXT) test-init.sh \ |
120 | test-unistd$(EXEEXT) test-vc-list-files-git.sh \ | |
121 | test-vc-list-files-cvs.sh test-verify$(EXEEXT) test-verify.sh \ | |
122 | test-wchar$(EXEEXT) | |
120 | test-unistd$(EXEEXT) test-update-copyright.sh \ | |
121 | test-vc-list-files-git.sh test-vc-list-files-cvs.sh \ | |
122 | test-verify$(EXEEXT) test-verify.sh test-wchar$(EXEEXT) | |
123 | 123 | XFAIL_TESTS = |
124 | 124 | noinst_PROGRAMS = |
125 | 125 | check_PROGRAMS = test-byteswap$(EXEEXT) test-des$(EXEEXT) \ |
133 | 133 | subdir = gl/tests |
134 | 134 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
135 | 135 | am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ |
136 | $(top_srcdir)/gl/m4/__inline.m4 \ | |
136 | 137 | $(top_srcdir)/gl/m4/absolute-header.m4 \ |
137 | 138 | $(top_srcdir)/gl/m4/autobuild.m4 \ |
138 | 139 | $(top_srcdir)/gl/m4/byteswap.m4 \ |
145 | 146 | $(top_srcdir)/gl/m4/inttypes-pri.m4 \ |
146 | 147 | $(top_srcdir)/gl/m4/inttypes.m4 \ |
147 | 148 | $(top_srcdir)/gl/m4/limits-h.m4 \ |
148 | $(top_srcdir)/gl/m4/longlong.m4 \ | |
149 | 149 | $(top_srcdir)/gl/m4/manywarnings.m4 $(top_srcdir)/gl/m4/md4.m4 \ |
150 | 150 | $(top_srcdir)/gl/m4/multiarch.m4 $(top_srcdir)/gl/m4/off_t.m4 \ |
151 | 151 | $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdalign.m4 \ |
158 | 158 | $(top_srcdir)/gl/m4/warn-on-use.m4 \ |
159 | 159 | $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_h.m4 \ |
160 | 160 | $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ |
161 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
162 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
163 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
161 | $(top_srcdir)/gl/m4/zzgnulib.m4 $(top_srcdir)/m4/libtool.m4 \ | |
162 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
163 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
164 | $(top_srcdir)/configure.ac | |
164 | 165 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
165 | 166 | $(ACLOCAL_M4) |
166 | 167 | DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ |
169 | 170 | CONFIG_HEADER = $(top_builddir)/config.h |
170 | 171 | CONFIG_CLEAN_FILES = |
171 | 172 | CONFIG_CLEAN_VPATH_FILES = |
173 | PROGRAMS = $(noinst_PROGRAMS) | |
172 | 174 | LIBRARIES = $(noinst_LIBRARIES) |
173 | 175 | AM_V_AR = $(am__v_AR_@AM_V@) |
174 | 176 | am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) |
178 | 180 | am__DEPENDENCIES_1 = |
179 | 181 | am_libtests_a_OBJECTS = dummy.$(OBJEXT) |
180 | 182 | libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) |
181 | PROGRAMS = $(noinst_PROGRAMS) | |
182 | 183 | test_byteswap_SOURCES = test-byteswap.c |
183 | 184 | test_byteswap_OBJECTS = test-byteswap.$(OBJEXT) |
184 | 185 | test_byteswap_LDADD = $(LDADD) |
282 | 283 | am__v_at_1 = |
283 | 284 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
284 | 285 | depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp |
285 | am__depfiles_maybe = depfiles | |
286 | am__maybe_remake_depfiles = depfiles | |
287 | am__depfiles_remade = ./$(DEPDIR)/dummy.Po \ | |
288 | ./$(DEPDIR)/test-byteswap.Po ./$(DEPDIR)/test-des.Po \ | |
289 | ./$(DEPDIR)/test-intprops.Po ./$(DEPDIR)/test-inttypes.Po \ | |
290 | ./$(DEPDIR)/test-limits-h.Po ./$(DEPDIR)/test-md4.Po \ | |
291 | ./$(DEPDIR)/test-stdalign.Po ./$(DEPDIR)/test-stdbool.Po \ | |
292 | ./$(DEPDIR)/test-stddef.Po ./$(DEPDIR)/test-stdint.Po \ | |
293 | ./$(DEPDIR)/test-string.Po ./$(DEPDIR)/test-strverscmp.Po \ | |
294 | ./$(DEPDIR)/test-sys_types.Po ./$(DEPDIR)/test-unistd.Po \ | |
295 | ./$(DEPDIR)/test-verify-try.Po ./$(DEPDIR)/test-verify.Po \ | |
296 | ./$(DEPDIR)/test-wchar.Po | |
286 | 297 | am__mv = mv -f |
287 | 298 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
288 | 299 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
335 | 346 | $(RECURSIVE_CLEAN_TARGETS) \ |
336 | 347 | $(am__extra_recursive_targets) |
337 | 348 | AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ |
338 | check recheck distdir | |
349 | check recheck distdir distdir-am | |
339 | 350 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) |
340 | 351 | # Read a list of newline-separated strings from the standard input, |
341 | 352 | # and print each of them once, without duplicates. Input order is |
623 | 634 | EGREP = @EGREP@ |
624 | 635 | EXEEXT = @EXEEXT@ |
625 | 636 | FGREP = @FGREP@ |
637 | GNULIB_ACCESS = @GNULIB_ACCESS@ | |
626 | 638 | GNULIB_BTOWC = @GNULIB_BTOWC@ |
627 | 639 | GNULIB_CHDIR = @GNULIB_CHDIR@ |
628 | 640 | GNULIB_CHOWN = @GNULIB_CHOWN@ |
629 | 641 | GNULIB_CLOSE = @GNULIB_CLOSE@ |
642 | GNULIB_COPY_FILE_RANGE = @GNULIB_COPY_FILE_RANGE@ | |
630 | 643 | GNULIB_DUP = @GNULIB_DUP@ |
631 | 644 | GNULIB_DUP2 = @GNULIB_DUP2@ |
632 | 645 | GNULIB_DUP3 = @GNULIB_DUP3@ |
648 | 661 | GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ |
649 | 662 | GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ |
650 | 663 | GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ |
664 | GNULIB_GETOPT_POSIX = @GNULIB_GETOPT_POSIX@ | |
651 | 665 | GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ |
652 | 666 | GNULIB_GETPASS = @GNULIB_GETPASS@ |
653 | 667 | GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ |
760 | 774 | HAVE_BTOWC = @HAVE_BTOWC@ |
761 | 775 | HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ |
762 | 776 | HAVE_CHOWN = @HAVE_CHOWN@ |
777 | HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ | |
763 | 778 | HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ |
764 | 779 | HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ |
765 | 780 | HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ |
811 | 826 | HAVE_LCHOWN = @HAVE_LCHOWN@ |
812 | 827 | HAVE_LINK = @HAVE_LINK@ |
813 | 828 | HAVE_LINKAT = @HAVE_LINKAT@ |
814 | HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ | |
815 | 829 | HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ |
816 | 830 | HAVE_MBRLEN = @HAVE_MBRLEN@ |
817 | 831 | HAVE_MBRTOWC = @HAVE_MBRTOWC@ |
850 | 864 | HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ |
851 | 865 | HAVE_UNISTD_H = @HAVE_UNISTD_H@ |
852 | 866 | HAVE_UNLINKAT = @HAVE_UNLINKAT@ |
853 | HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ | |
854 | 867 | HAVE_USLEEP = @HAVE_USLEEP@ |
855 | 868 | HAVE_WCHAR_H = @HAVE_WCHAR_H@ |
856 | 869 | HAVE_WCHAR_T = @HAVE_WCHAR_T@ |
950 | 963 | PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ |
951 | 964 | PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ |
952 | 965 | RANLIB = @RANLIB@ |
966 | REPLACE_ACCESS = @REPLACE_ACCESS@ | |
953 | 967 | REPLACE_BTOWC = @REPLACE_BTOWC@ |
954 | 968 | REPLACE_CHOWN = @REPLACE_CHOWN@ |
955 | 969 | REPLACE_CLOSE = @REPLACE_CLOSE@ |
1011 | 1025 | REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ |
1012 | 1026 | REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ |
1013 | 1027 | REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ |
1028 | REPLACE_WCSTOK = @REPLACE_WCSTOK@ | |
1014 | 1029 | REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ |
1015 | 1030 | REPLACE_WCTOB = @REPLACE_WCTOB@ |
1016 | 1031 | REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ |
1096 | 1111 | top_build_prefix = @top_build_prefix@ |
1097 | 1112 | top_builddir = @top_builddir@ |
1098 | 1113 | top_srcdir = @top_srcdir@ |
1099 | AUTOMAKE_OPTIONS = 1.9.6 foreign | |
1114 | AUTOMAKE_OPTIONS = 1.11 foreign | |
1100 | 1115 | SUBDIRS = . |
1101 | 1116 | TESTS_ENVIRONMENT = EXEEXT='@EXEEXT@' srcdir='$(srcdir)' \ |
1102 | abs_aux_dir='$(abs_aux_dir)' MAKE='$(MAKE)' | |
1117 | abs_aux_dir='$(abs_aux_dir)' abs_aux_dir='$(abs_aux_dir)' \ | |
1118 | MAKE='$(MAKE)' | |
1103 | 1119 | noinst_HEADERS = |
1104 | 1120 | noinst_LIBRARIES = |
1105 | 1121 | check_LIBRARIES = libtests.a |
1109 | 1125 | test-stdalign.c macros.h test-stdbool.c test-stddef.c \ |
1110 | 1126 | test-stdint.c test-string.c test-strverscmp.c signature.h \ |
1111 | 1127 | macros.h test-sys_types.c init.sh test-init.sh test-unistd.c \ |
1112 | test-vc-list-files-git.sh test-vc-list-files-cvs.sh verify.h \ | |
1113 | test-verify.c test-verify-try.c test-verify.sh wchar.in.h \ | |
1114 | test-wchar.c | |
1128 | test-update-copyright.sh test-vc-list-files-git.sh \ | |
1129 | test-vc-list-files-cvs.sh verify.h test-verify.c \ | |
1130 | test-verify-try.c test-verify.sh wchar.in.h test-wchar.c | |
1115 | 1131 | BUILT_SOURCES = inttypes.h wchar.h |
1116 | 1132 | SUFFIXES = |
1117 | 1133 | |
1173 | 1189 | *config.status*) \ |
1174 | 1190 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ |
1175 | 1191 | *) \ |
1176 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | |
1177 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | |
1192 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ | |
1193 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ | |
1178 | 1194 | esac; |
1179 | 1195 | |
1180 | 1196 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) |
1185 | 1201 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) |
1186 | 1202 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh |
1187 | 1203 | $(am__aclocal_m4_deps): |
1188 | ||
1189 | clean-checkLIBRARIES: | |
1190 | -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) | |
1191 | ||
1192 | clean-noinstLIBRARIES: | |
1193 | -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) | |
1194 | ||
1195 | libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) | |
1196 | $(AM_V_at)-rm -f libtests.a | |
1197 | $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) | |
1198 | $(AM_V_at)$(RANLIB) libtests.a | |
1199 | 1204 | |
1200 | 1205 | clean-checkPROGRAMS: |
1201 | 1206 | @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ |
1215 | 1220 | echo " rm -f" $$list; \ |
1216 | 1221 | rm -f $$list |
1217 | 1222 | |
1223 | clean-checkLIBRARIES: | |
1224 | -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) | |
1225 | ||
1226 | clean-noinstLIBRARIES: | |
1227 | -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) | |
1228 | ||
1229 | libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) | |
1230 | $(AM_V_at)-rm -f libtests.a | |
1231 | $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) | |
1232 | $(AM_V_at)$(RANLIB) libtests.a | |
1233 | ||
1218 | 1234 | test-byteswap$(EXEEXT): $(test_byteswap_OBJECTS) $(test_byteswap_DEPENDENCIES) $(EXTRA_test_byteswap_DEPENDENCIES) |
1219 | 1235 | @rm -f test-byteswap$(EXEEXT) |
1220 | 1236 | $(AM_V_CCLD)$(LINK) $(test_byteswap_OBJECTS) $(test_byteswap_LDADD) $(LIBS) |
1289 | 1305 | distclean-compile: |
1290 | 1306 | -rm -f *.tab.c |
1291 | 1307 | |
1292 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Po@am__quote@ | |
1293 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-byteswap.Po@am__quote@ | |
1294 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-des.Po@am__quote@ | |
1295 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-intprops.Po@am__quote@ | |
1296 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes.Po@am__quote@ | |
1297 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-limits-h.Po@am__quote@ | |
1298 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-md4.Po@am__quote@ | |
1299 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdalign.Po@am__quote@ | |
1300 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool.Po@am__quote@ | |
1301 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef.Po@am__quote@ | |
1302 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@ | |
1303 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string.Po@am__quote@ | |
1304 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strverscmp.Po@am__quote@ | |
1305 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types.Po@am__quote@ | |
1306 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@ | |
1307 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify-try.Po@am__quote@ | |
1308 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify.Po@am__quote@ | |
1309 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar.Po@am__quote@ | |
1308 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Po@am__quote@ # am--include-marker | |
1309 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-byteswap.Po@am__quote@ # am--include-marker | |
1310 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-des.Po@am__quote@ # am--include-marker | |
1311 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-intprops.Po@am__quote@ # am--include-marker | |
1312 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes.Po@am__quote@ # am--include-marker | |
1313 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-limits-h.Po@am__quote@ # am--include-marker | |
1314 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-md4.Po@am__quote@ # am--include-marker | |
1315 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdalign.Po@am__quote@ # am--include-marker | |
1316 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool.Po@am__quote@ # am--include-marker | |
1317 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef.Po@am__quote@ # am--include-marker | |
1318 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@ # am--include-marker | |
1319 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string.Po@am__quote@ # am--include-marker | |
1320 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strverscmp.Po@am__quote@ # am--include-marker | |
1321 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types.Po@am__quote@ # am--include-marker | |
1322 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@ # am--include-marker | |
1323 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify-try.Po@am__quote@ # am--include-marker | |
1324 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify.Po@am__quote@ # am--include-marker | |
1325 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar.Po@am__quote@ # am--include-marker | |
1326 | ||
1327 | $(am__depfiles_remade): | |
1328 | @$(MKDIR_P) $(@D) | |
1329 | @echo '# dummy' >$@-t && $(am__mv) $@-t $@ | |
1330 | ||
1331 | am--depfiles: $(am__depfiles_remade) | |
1310 | 1332 | |
1311 | 1333 | .c.o: |
1312 | 1334 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |
1554 | 1576 | fi; \ |
1555 | 1577 | $$success || exit 1 |
1556 | 1578 | |
1557 | check-TESTS: | |
1579 | check-TESTS: $(check_PROGRAMS) $(check_LIBRARIES) | |
1558 | 1580 | @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list |
1559 | 1581 | @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list |
1560 | 1582 | @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) |
1564 | 1586 | log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ |
1565 | 1587 | $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ |
1566 | 1588 | exit $$?; |
1567 | recheck: all $(check_LIBRARIES) $(check_PROGRAMS) | |
1589 | recheck: all $(check_PROGRAMS) $(check_LIBRARIES) | |
1568 | 1590 | @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) |
1569 | 1591 | @set +e; $(am__set_TESTS_bases); \ |
1570 | 1592 | bases=`for i in $$bases; do echo $$i; done \ |
1680 | 1702 | --log-file $$b.log --trs-file $$b.trs \ |
1681 | 1703 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ |
1682 | 1704 | "$$tst" $(AM_TESTS_FD_REDIRECT) |
1705 | test-update-copyright.sh.log: test-update-copyright.sh | |
1706 | @p='test-update-copyright.sh'; \ | |
1707 | b='test-update-copyright.sh'; \ | |
1708 | $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ | |
1709 | --log-file $$b.log --trs-file $$b.trs \ | |
1710 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ | |
1711 | "$$tst" $(AM_TESTS_FD_REDIRECT) | |
1683 | 1712 | test-vc-list-files-git.sh.log: test-vc-list-files-git.sh |
1684 | 1713 | @p='test-vc-list-files-git.sh'; \ |
1685 | 1714 | b='test-vc-list-files-git.sh'; \ |
1730 | 1759 | @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ |
1731 | 1760 | @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) |
1732 | 1761 | |
1733 | distdir: $(DISTFILES) | |
1762 | distdir: $(BUILT_SOURCES) | |
1763 | $(MAKE) $(AM_MAKEFLAGS) distdir-am | |
1764 | ||
1765 | distdir-am: $(DISTFILES) | |
1734 | 1766 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ |
1735 | 1767 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ |
1736 | 1768 | list='$(DISTFILES)'; \ |
1786 | 1818 | fi; \ |
1787 | 1819 | done |
1788 | 1820 | check-am: all-am |
1789 | $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) | |
1821 | $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_LIBRARIES) | |
1790 | 1822 | $(MAKE) $(AM_MAKEFLAGS) check-TESTS |
1791 | 1823 | check: $(BUILT_SOURCES) |
1792 | 1824 | $(MAKE) $(AM_MAKEFLAGS) check-recursive |
1793 | all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) | |
1825 | all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(HEADERS) | |
1794 | 1826 | installdirs: installdirs-recursive |
1795 | 1827 | installdirs-am: |
1796 | 1828 | install: $(BUILT_SOURCES) |
1839 | 1871 | clean-noinstPROGRAMS mostlyclean-am |
1840 | 1872 | |
1841 | 1873 | distclean: distclean-recursive |
1842 | -rm -rf ./$(DEPDIR) | |
1874 | -rm -f ./$(DEPDIR)/dummy.Po | |
1875 | -rm -f ./$(DEPDIR)/test-byteswap.Po | |
1876 | -rm -f ./$(DEPDIR)/test-des.Po | |
1877 | -rm -f ./$(DEPDIR)/test-intprops.Po | |
1878 | -rm -f ./$(DEPDIR)/test-inttypes.Po | |
1879 | -rm -f ./$(DEPDIR)/test-limits-h.Po | |
1880 | -rm -f ./$(DEPDIR)/test-md4.Po | |
1881 | -rm -f ./$(DEPDIR)/test-stdalign.Po | |
1882 | -rm -f ./$(DEPDIR)/test-stdbool.Po | |
1883 | -rm -f ./$(DEPDIR)/test-stddef.Po | |
1884 | -rm -f ./$(DEPDIR)/test-stdint.Po | |
1885 | -rm -f ./$(DEPDIR)/test-string.Po | |
1886 | -rm -f ./$(DEPDIR)/test-strverscmp.Po | |
1887 | -rm -f ./$(DEPDIR)/test-sys_types.Po | |
1888 | -rm -f ./$(DEPDIR)/test-unistd.Po | |
1889 | -rm -f ./$(DEPDIR)/test-verify-try.Po | |
1890 | -rm -f ./$(DEPDIR)/test-verify.Po | |
1891 | -rm -f ./$(DEPDIR)/test-wchar.Po | |
1843 | 1892 | -rm -f Makefile |
1844 | 1893 | distclean-am: clean-am distclean-compile distclean-generic \ |
1845 | 1894 | distclean-tags |
1885 | 1934 | installcheck-am: |
1886 | 1935 | |
1887 | 1936 | maintainer-clean: maintainer-clean-recursive |
1888 | -rm -rf ./$(DEPDIR) | |
1937 | -rm -f ./$(DEPDIR)/dummy.Po | |
1938 | -rm -f ./$(DEPDIR)/test-byteswap.Po | |
1939 | -rm -f ./$(DEPDIR)/test-des.Po | |
1940 | -rm -f ./$(DEPDIR)/test-intprops.Po | |
1941 | -rm -f ./$(DEPDIR)/test-inttypes.Po | |
1942 | -rm -f ./$(DEPDIR)/test-limits-h.Po | |
1943 | -rm -f ./$(DEPDIR)/test-md4.Po | |
1944 | -rm -f ./$(DEPDIR)/test-stdalign.Po | |
1945 | -rm -f ./$(DEPDIR)/test-stdbool.Po | |
1946 | -rm -f ./$(DEPDIR)/test-stddef.Po | |
1947 | -rm -f ./$(DEPDIR)/test-stdint.Po | |
1948 | -rm -f ./$(DEPDIR)/test-string.Po | |
1949 | -rm -f ./$(DEPDIR)/test-strverscmp.Po | |
1950 | -rm -f ./$(DEPDIR)/test-sys_types.Po | |
1951 | -rm -f ./$(DEPDIR)/test-unistd.Po | |
1952 | -rm -f ./$(DEPDIR)/test-verify-try.Po | |
1953 | -rm -f ./$(DEPDIR)/test-verify.Po | |
1954 | -rm -f ./$(DEPDIR)/test-wchar.Po | |
1889 | 1955 | -rm -f Makefile |
1890 | 1956 | maintainer-clean-am: distclean-am maintainer-clean-generic |
1891 | 1957 | |
1907 | 1973 | .MAKE: $(am__recursive_targets) all check check-am install install-am \ |
1908 | 1974 | install-strip |
1909 | 1975 | |
1910 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ | |
1911 | check-TESTS check-am clean clean-checkLIBRARIES \ | |
1912 | clean-checkPROGRAMS clean-generic clean-libtool clean-local \ | |
1913 | clean-noinstLIBRARIES clean-noinstPROGRAMS cscopelist-am ctags \ | |
1914 | ctags-am distclean distclean-compile distclean-generic \ | |
1915 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | |
1916 | html-am info info-am install install-am install-data \ | |
1917 | install-data-am install-dvi install-dvi-am install-exec \ | |
1918 | install-exec-am install-html install-html-am install-info \ | |
1919 | install-info-am install-man install-pdf install-pdf-am \ | |
1920 | install-ps install-ps-am install-strip installcheck \ | |
1921 | installcheck-am installdirs installdirs-am maintainer-clean \ | |
1922 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | |
1923 | mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ | |
1924 | pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am | |
1976 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ | |
1977 | am--depfiles check check-TESTS check-am clean \ | |
1978 | clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ | |
1979 | clean-libtool clean-local clean-noinstLIBRARIES \ | |
1980 | clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ | |
1981 | distclean-compile distclean-generic distclean-libtool \ | |
1982 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | |
1983 | install install-am install-data install-data-am install-dvi \ | |
1984 | install-dvi-am install-exec install-exec-am install-html \ | |
1985 | install-html-am install-info install-info-am install-man \ | |
1986 | install-pdf install-pdf-am install-ps install-ps-am \ | |
1987 | install-strip installcheck installcheck-am installdirs \ | |
1988 | installdirs-am maintainer-clean maintainer-clean-generic \ | |
1989 | mostlyclean mostlyclean-compile mostlyclean-generic \ | |
1990 | mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \ | |
1991 | recheck tags tags-am uninstall uninstall-am | |
1925 | 1992 | |
1926 | 1993 | .PRECIOUS: Makefile |
1927 | 1994 | |
1938 | 2005 | -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ |
1939 | 2006 | -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ |
1940 | 2007 | -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ |
1941 | -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ | |
1942 | -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ | |
1943 | 2008 | -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ |
1944 | 2009 | -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ |
1945 | 2010 | -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ |
2074 | 2139 | -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ |
2075 | 2140 | -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ |
2076 | 2141 | -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \ |
2142 | -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \ | |
2077 | 2143 | -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ |
2078 | 2144 | -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ |
2079 | 2145 | -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ |
0 | 0 | /* A C macro for declaring that specific arguments must not be NULL. |
1 | Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify it |
4 | 4 | under the terms of the GNU General Public License as published |
0 | 0 | /* C++ compatible function declaration macros. |
1 | Copyright (C) 2010-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify it |
4 | 4 | under the terms of the GNU General Public License as published |
300 | 300 | _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ |
301 | 301 | "The symbol ::" #func " refers to the system function. " \ |
302 | 302 | "Use " #namespace "::" #func " instead.") |
303 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING | |
304 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ | |
305 | extern __typeof__ (func) func | |
306 | 303 | # else |
307 | 304 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
308 | 305 | _GL_EXTERN_C int _gl_cxxalias_dummy |
0 | 0 | /* A dummy file, to prevent empty libraries from breaking builds. |
1 | Copyright (C) 2004, 2007, 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2004, 2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | # source this file; set up for tests |
1 | 1 | |
2 | # Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | # This program is free software: you can redistribute it and/or modify |
5 | 5 | # it under the terms of the GNU General Public License as published by |
59 | 59 | # 4. Finally |
60 | 60 | # $ exit |
61 | 61 | |
62 | # ============================================================================= | |
63 | # Elementary diagnostics | |
64 | ||
62 | 65 | ME_=`expr "./$0" : '.*/\(.*\)$'` |
63 | 66 | |
64 | 67 | # Prepare PATH_SEPARATOR. |
108 | 111 | fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; } |
109 | 112 | framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; } |
110 | 113 | |
111 | # This is used to simplify checking of the return value | |
112 | # which is useful when ensuring a command fails as desired. | |
113 | # I.e., just doing `command ... &&fail=1` will not catch | |
114 | # a segfault in command for example. With this helper you | |
115 | # instead check an explicit exit code like | |
116 | # returns_ 1 command ... || fail | |
117 | returns_ () { | |
118 | # Disable tracing so it doesn't interfere with stderr of the wrapped command | |
119 | { set +x; } 2>/dev/null | |
120 | ||
121 | local exp_exit="$1" | |
122 | shift | |
123 | "$@" | |
124 | test $? -eq $exp_exit && ret_=0 || ret_=1 | |
125 | ||
126 | if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then | |
127 | set -x | |
128 | fi | |
129 | { return $ret_; } 2>/dev/null | |
130 | } | |
114 | # ============================================================================= | |
115 | # Ensure the shell supports modern syntax. | |
131 | 116 | |
132 | 117 | # Sanitize this shell to POSIX mode, if possible. |
133 | 118 | DUALCASE=1; export DUALCASE |
143 | 128 | fi |
144 | 129 | |
145 | 130 | # We require $(...) support unconditionally. |
131 | # We require that the printf built-in work correctly regarding octal escapes; | |
132 | # this eliminates /bin/sh on AIX 7.2. | |
146 | 133 | # We require non-surprising "local" semantics (this eliminates dash). |
147 | 134 | # This takes the admittedly draconian step of eliminating dash, because the |
148 | 135 | # assignment tab=$(printf '\t') works fine, yet preceding it with "local " |
172 | 159 | # ? - not ok |
173 | 160 | gl_shell_test_script_=' |
174 | 161 | test $(echo y) = y || exit 1 |
162 | LC_ALL=en_US.UTF-8 printf "\\351" 2>/dev/null \ | |
163 | | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \ | |
164 | || exit 1 | |
165 | printf "\\351" 2>/dev/null \ | |
166 | | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \ | |
167 | || exit 1 | |
175 | 168 | f_local_() { local v=1; }; f_local_ || exit 1 |
176 | 169 | f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_ |
177 | 170 | score_=10 |
254 | 247 | fi |
255 | 248 | fi |
256 | 249 | |
250 | # ============================================================================= | |
251 | # Ensure the shell behaves reasonably. | |
252 | ||
257 | 253 | # If this is bash, turn off all aliases. |
258 | 254 | test -n "$BASH_VERSION" && unalias -a |
259 | 255 | |
264 | 260 | # widespread than that for hyphen-containing function names. |
265 | 261 | test -n "$EXEEXT" && test -n "$BASH_VERSION" && shopt -s expand_aliases |
266 | 262 | |
267 | # Enable glibc's malloc-perturbing option. | |
268 | # This is useful for exposing code that depends on the fact that | |
269 | # malloc-related functions often return memory that is mostly zeroed. | |
270 | # If you have the time and cycles, use valgrind to do an even better job. | |
271 | : ${MALLOC_PERTURB_=87} | |
272 | export MALLOC_PERTURB_ | |
263 | # ============================================================================= | |
264 | # Creating a temporary directory (needed by the core test framework) | |
265 | ||
266 | # Create a temporary directory, much like mktemp -d does. | |
267 | # Written by Jim Meyering. | |
268 | # | |
269 | # Usage: mktempd_ /tmp phoey.XXXXXXXXXX | |
270 | # | |
271 | # First, try to use the mktemp program. | |
272 | # Failing that, we'll roll our own mktemp-like function: | |
273 | # - try to get random bytes from /dev/urandom | |
274 | # - failing that, generate output from a combination of quickly-varying | |
275 | # sources and gzip. Ignore non-varying gzip header, and extract | |
276 | # "random" bits from there. | |
277 | # - given those bits, map to file-name bytes using tr, and try to create | |
278 | # the desired directory. | |
279 | # - make only $MAX_TRIES_ attempts | |
280 | ||
281 | # Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. | |
282 | rand_bytes_ () | |
283 | { | |
284 | n_=$1 | |
285 | ||
286 | # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? | |
287 | # But if they have openssl, they probably have mktemp, too. | |
288 | ||
289 | chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 | |
290 | dev_rand_=/dev/urandom | |
291 | if test -r "$dev_rand_"; then | |
292 | # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. | |
293 | dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ | |
294 | | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ | |
295 | return | |
296 | fi | |
297 | ||
298 | n_plus_50_=`expr $n_ + 50` | |
299 | cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef' | |
300 | data_=` (eval "$cmds_") 2>&1 | gzip ` | |
301 | ||
302 | # Ensure that $data_ has length at least 50+$n_ | |
303 | while :; do | |
304 | len_=`echo "$data_"|wc -c` | |
305 | test $n_plus_50_ -le $len_ && break; | |
306 | data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` | |
307 | done | |
308 | ||
309 | echo "$data_" \ | |
310 | | dd bs=1 skip=50 count=$n_ 2>/dev/null \ | |
311 | | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ | |
312 | } | |
313 | ||
314 | mktempd_ () | |
315 | { | |
316 | case $# in | |
317 | 2);; | |
318 | *) fail_ "Usage: mktempd_ DIR TEMPLATE";; | |
319 | esac | |
320 | ||
321 | destdir_=$1 | |
322 | template_=$2 | |
323 | ||
324 | MAX_TRIES_=4 | |
325 | ||
326 | # Disallow any trailing slash on specified destdir: | |
327 | # it would subvert the post-mktemp "case"-based destdir test. | |
328 | case $destdir_ in | |
329 | / | //) destdir_slash_=$destdir;; | |
330 | */) fail_ "invalid destination dir: remove trailing slash(es)";; | |
331 | *) destdir_slash_=$destdir_/;; | |
332 | esac | |
333 | ||
334 | case $template_ in | |
335 | *XXXX) ;; | |
336 | *) fail_ \ | |
337 | "invalid template: $template_ (must have a suffix of at least 4 X's)";; | |
338 | esac | |
339 | ||
340 | # First, try to use mktemp. | |
341 | d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && | |
342 | ||
343 | # The resulting name must be in the specified directory. | |
344 | case $d in "$destdir_slash_"*) :;; *) false;; esac && | |
345 | ||
346 | # It must have created the directory. | |
347 | test -d "$d" && | |
348 | ||
349 | # It must have 0700 permissions. Handle sticky "S" bits. | |
350 | perms=`ls -dgo "$d" 2>/dev/null` && | |
351 | case $perms in drwx--[-S]---*) :;; *) false;; esac && { | |
352 | echo "$d" | |
353 | return | |
354 | } | |
355 | ||
356 | # If we reach this point, we'll have to create a directory manually. | |
357 | ||
358 | # Get a copy of the template without its suffix of X's. | |
359 | base_template_=`echo "$template_"|sed 's/XX*$//'` | |
360 | ||
361 | # Calculate how many X's we've just removed. | |
362 | template_length_=`echo "$template_" | wc -c` | |
363 | nx_=`echo "$base_template_" | wc -c` | |
364 | nx_=`expr $template_length_ - $nx_` | |
365 | ||
366 | err_= | |
367 | i_=1 | |
368 | while :; do | |
369 | X_=`rand_bytes_ $nx_` | |
370 | candidate_dir_="$destdir_slash_$base_template_$X_" | |
371 | err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ | |
372 | && { echo "$candidate_dir_"; return; } | |
373 | test $MAX_TRIES_ -le $i_ && break; | |
374 | i_=`expr $i_ + 1` | |
375 | done | |
376 | fail_ "$err_" | |
377 | } | |
378 | ||
379 | # ============================================================================= | |
380 | # Core test framework | |
381 | ||
382 | # An arbitrary prefix to help distinguish test directories. | |
383 | testdir_prefix_ () { printf gt; } | |
384 | ||
385 | # Set up the environment for the test to run in. | |
386 | setup_ () | |
387 | { | |
388 | if test "$VERBOSE" = yes; then | |
389 | # Test whether set -x may cause the selected shell to corrupt an | |
390 | # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh | |
391 | # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5. | |
392 | # If enabling verbose output this way would cause trouble, simply | |
393 | # issue a warning and refrain. | |
394 | if $gl_set_x_corrupts_stderr_; then | |
395 | warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" | |
396 | else | |
397 | set -x | |
398 | fi | |
399 | fi | |
400 | ||
401 | initial_cwd_=$PWD | |
402 | ||
403 | # Create and enter the temporary directory. | |
404 | pfx_=`testdir_prefix_` | |
405 | test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ | |
406 | || fail_ "failed to create temporary directory in $initial_cwd_" | |
407 | cd "$test_dir_" || fail_ "failed to cd to temporary directory" | |
408 | # Set variables srcdir, builddir, for the convenience of the test. | |
409 | case $srcdir in | |
410 | /* | ?:*) ;; | |
411 | *) srcdir="../$srcdir" ;; | |
412 | esac | |
413 | builddir=".." | |
414 | export srcdir builddir | |
415 | ||
416 | # As autoconf-generated configure scripts do, ensure that IFS | |
417 | # is defined initially, so that saving and restoring $IFS works. | |
418 | gl_init_sh_nl_=' | |
419 | ' | |
420 | IFS=" "" $gl_init_sh_nl_" | |
421 | ||
422 | # This trap statement, along with a trap on 0 below, ensure that the | |
423 | # temporary directory, $test_dir_, is removed upon exit as well as | |
424 | # upon receipt of any of the listed signals. | |
425 | for sig_ in 1 2 3 13 15; do | |
426 | eval "trap 'Exit $(expr $sig_ + 128)' $sig_" | |
427 | done | |
428 | } | |
273 | 429 | |
274 | 430 | # This is a stub function that is run upon trap (upon regular exit and |
275 | 431 | # interrupt). Override it with a per-test function, e.g., to unmount |
276 | 432 | # a partition, or to undo any other global state changes. |
277 | 433 | cleanup_ () { :; } |
278 | ||
279 | # Emit a header similar to that from diff -u; Print the simulated "diff" | |
280 | # command so that the order of arguments is clear. Don't bother with @@ lines. | |
281 | emit_diff_u_header_ () | |
282 | { | |
283 | printf '%s\n' "diff -u $*" \ | |
284 | "--- $1 1970-01-01" \ | |
285 | "+++ $2 1970-01-01" | |
286 | } | |
287 | ||
288 | # Arrange not to let diff or cmp operate on /dev/null, | |
289 | # since on some systems (at least OSF/1 5.1), that doesn't work. | |
290 | # When there are not two arguments, or no argument is /dev/null, return 2. | |
291 | # When one argument is /dev/null and the other is not empty, | |
292 | # cat the nonempty file to stderr and return 1. | |
293 | # Otherwise, return 0. | |
294 | compare_dev_null_ () | |
295 | { | |
296 | test $# = 2 || return 2 | |
297 | ||
298 | if test "x$1" = x/dev/null; then | |
299 | test -s "$2" || return 0 | |
300 | emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" | |
301 | return 1 | |
302 | fi | |
303 | ||
304 | if test "x$2" = x/dev/null; then | |
305 | test -s "$1" || return 0 | |
306 | emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" | |
307 | return 1 | |
308 | fi | |
309 | ||
310 | return 2 | |
311 | } | |
312 | ||
313 | for diff_opt_ in -u -U3 -c '' no; do | |
314 | test "$diff_opt_" != no && | |
315 | diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && | |
316 | break | |
317 | done | |
318 | if test "$diff_opt_" != no; then | |
319 | if test -z "$diff_out_"; then | |
320 | compare_ () { diff $diff_opt_ "$@"; } | |
321 | else | |
322 | compare_ () | |
323 | { | |
324 | # If no differences were found, AIX and HP-UX 'diff' produce output | |
325 | # like "No differences encountered". Hide this output. | |
326 | diff $diff_opt_ "$@" > diff.out | |
327 | diff_status_=$? | |
328 | test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 | |
329 | rm -f diff.out || diff_status_=2 | |
330 | return $diff_status_ | |
331 | } | |
332 | fi | |
333 | elif cmp -s /dev/null /dev/null 2>/dev/null; then | |
334 | compare_ () { cmp -s "$@"; } | |
335 | else | |
336 | compare_ () { cmp "$@"; } | |
337 | fi | |
338 | ||
339 | # Usage: compare EXPECTED ACTUAL | |
340 | # | |
341 | # Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. | |
342 | # Otherwise, propagate $? to caller: any diffs have already been printed. | |
343 | compare () | |
344 | { | |
345 | # This looks like it can be factored to use a simple "case $?" | |
346 | # after unchecked compare_dev_null_ invocation, but that would | |
347 | # fail in a "set -e" environment. | |
348 | if compare_dev_null_ "$@"; then | |
349 | return 0 | |
350 | else | |
351 | case $? in | |
352 | 1) return 1;; | |
353 | *) compare_ "$@";; | |
354 | esac | |
355 | fi | |
356 | } | |
357 | ||
358 | # An arbitrary prefix to help distinguish test directories. | |
359 | testdir_prefix_ () { printf gt; } | |
360 | 434 | |
361 | 435 | # Run the user-overridable cleanup_ function, remove the temporary |
362 | 436 | # directory and exit with the incoming value of $?. |
375 | 449 | fi |
376 | 450 | exit $__st |
377 | 451 | } |
452 | ||
453 | # ============================================================================= | |
454 | # Prepending directories to PATH | |
378 | 455 | |
379 | 456 | # Given a directory name, DIR, if every entry in it that matches *.exe |
380 | 457 | # contains only the specified bytes (see the case stmt below), then print |
457 | 534 | export PATH |
458 | 535 | } |
459 | 536 | |
460 | setup_ () | |
461 | { | |
462 | if test "$VERBOSE" = yes; then | |
463 | # Test whether set -x may cause the selected shell to corrupt an | |
464 | # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh | |
465 | # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5. | |
466 | # If enabling verbose output this way would cause trouble, simply | |
467 | # issue a warning and refrain. | |
468 | if $gl_set_x_corrupts_stderr_; then | |
469 | warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" | |
470 | else | |
471 | set -x | |
472 | fi | |
473 | fi | |
474 | ||
475 | initial_cwd_=$PWD | |
476 | ||
477 | pfx_=`testdir_prefix_` | |
478 | test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ | |
479 | || fail_ "failed to create temporary directory in $initial_cwd_" | |
480 | cd "$test_dir_" || fail_ "failed to cd to temporary directory" | |
481 | ||
482 | # As autoconf-generated configure scripts do, ensure that IFS | |
483 | # is defined initially, so that saving and restoring $IFS works. | |
484 | gl_init_sh_nl_=' | |
485 | ' | |
486 | IFS=" "" $gl_init_sh_nl_" | |
487 | ||
488 | # This trap statement, along with a trap on 0 below, ensure that the | |
489 | # temporary directory, $test_dir_, is removed upon exit as well as | |
490 | # upon receipt of any of the listed signals. | |
491 | for sig_ in 1 2 3 13 15; do | |
492 | eval "trap 'Exit $(expr $sig_ + 128)' $sig_" | |
493 | done | |
494 | } | |
495 | ||
496 | # Create a temporary directory, much like mktemp -d does. | |
497 | # Written by Jim Meyering. | |
498 | # | |
499 | # Usage: mktempd_ /tmp phoey.XXXXXXXXXX | |
500 | # | |
501 | # First, try to use the mktemp program. | |
502 | # Failing that, we'll roll our own mktemp-like function: | |
503 | # - try to get random bytes from /dev/urandom | |
504 | # - failing that, generate output from a combination of quickly-varying | |
505 | # sources and gzip. Ignore non-varying gzip header, and extract | |
506 | # "random" bits from there. | |
507 | # - given those bits, map to file-name bytes using tr, and try to create | |
508 | # the desired directory. | |
509 | # - make only $MAX_TRIES_ attempts | |
510 | ||
511 | # Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. | |
512 | rand_bytes_ () | |
513 | { | |
514 | n_=$1 | |
515 | ||
516 | # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? | |
517 | # But if they have openssl, they probably have mktemp, too. | |
518 | ||
519 | chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 | |
520 | dev_rand_=/dev/urandom | |
521 | if test -r "$dev_rand_"; then | |
522 | # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. | |
523 | dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ | |
524 | | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ | |
525 | return | |
526 | fi | |
527 | ||
528 | n_plus_50_=`expr $n_ + 50` | |
529 | cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef' | |
530 | data_=` (eval "$cmds_") 2>&1 | gzip ` | |
531 | ||
532 | # Ensure that $data_ has length at least 50+$n_ | |
533 | while :; do | |
534 | len_=`echo "$data_"|wc -c` | |
535 | test $n_plus_50_ -le $len_ && break; | |
536 | data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` | |
537 | done | |
538 | ||
539 | echo "$data_" \ | |
540 | | dd bs=1 skip=50 count=$n_ 2>/dev/null \ | |
541 | | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ | |
542 | } | |
543 | ||
544 | mktempd_ () | |
545 | { | |
546 | case $# in | |
547 | 2);; | |
548 | *) fail_ "Usage: mktempd_ DIR TEMPLATE";; | |
549 | esac | |
550 | ||
551 | destdir_=$1 | |
552 | template_=$2 | |
553 | ||
554 | MAX_TRIES_=4 | |
555 | ||
556 | # Disallow any trailing slash on specified destdir: | |
557 | # it would subvert the post-mktemp "case"-based destdir test. | |
558 | case $destdir_ in | |
559 | / | //) destdir_slash_=$destdir;; | |
560 | */) fail_ "invalid destination dir: remove trailing slash(es)";; | |
561 | *) destdir_slash_=$destdir_/;; | |
562 | esac | |
563 | ||
564 | case $template_ in | |
565 | *XXXX) ;; | |
566 | *) fail_ \ | |
567 | "invalid template: $template_ (must have a suffix of at least 4 X's)";; | |
568 | esac | |
569 | ||
570 | # First, try to use mktemp. | |
571 | d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && | |
572 | ||
573 | # The resulting name must be in the specified directory. | |
574 | case $d in "$destdir_slash_"*) :;; *) false;; esac && | |
575 | ||
576 | # It must have created the directory. | |
577 | test -d "$d" && | |
578 | ||
579 | # It must have 0700 permissions. Handle sticky "S" bits. | |
580 | perms=`ls -dgo "$d" 2>/dev/null` && | |
581 | case $perms in drwx--[-S]---*) :;; *) false;; esac && { | |
582 | echo "$d" | |
583 | return | |
584 | } | |
585 | ||
586 | # If we reach this point, we'll have to create a directory manually. | |
587 | ||
588 | # Get a copy of the template without its suffix of X's. | |
589 | base_template_=`echo "$template_"|sed 's/XX*$//'` | |
590 | ||
591 | # Calculate how many X's we've just removed. | |
592 | template_length_=`echo "$template_" | wc -c` | |
593 | nx_=`echo "$base_template_" | wc -c` | |
594 | nx_=`expr $template_length_ - $nx_` | |
595 | ||
596 | err_= | |
597 | i_=1 | |
598 | while :; do | |
599 | X_=`rand_bytes_ $nx_` | |
600 | candidate_dir_="$destdir_slash_$base_template_$X_" | |
601 | err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ | |
602 | && { echo "$candidate_dir_"; return; } | |
603 | test $MAX_TRIES_ -le $i_ && break; | |
604 | i_=`expr $i_ + 1` | |
605 | done | |
606 | fail_ "$err_" | |
607 | } | |
537 | # ============================================================================= | |
538 | # Convenience environment variables for the tests | |
539 | ||
540 | # ----------------------------------------------------------------------------- | |
541 | ||
542 | # Enable glibc's malloc-perturbing option. | |
543 | # This is useful for exposing code that depends on the fact that | |
544 | # malloc-related functions often return memory that is mostly zeroed. | |
545 | # If you have the time and cycles, use valgrind to do an even better job. | |
546 | : ${MALLOC_PERTURB_=87} | |
547 | export MALLOC_PERTURB_ | |
548 | ||
549 | # ----------------------------------------------------------------------------- | |
550 | ||
551 | # The interpreter for Bourne-shell scripts. | |
552 | # No special standards compatibility requirements. | |
553 | # Some environments, such as Android, don't have /bin/sh. | |
554 | if test -f /bin/sh$EXEEXT; then | |
555 | BOURNE_SHELL=/bin/sh | |
556 | else | |
557 | BOURNE_SHELL=sh | |
558 | fi | |
559 | ||
560 | # ============================================================================= | |
561 | # Convenience functions for the tests | |
562 | ||
563 | # ----------------------------------------------------------------------------- | |
564 | # Return value checking | |
565 | ||
566 | # This is used to simplify checking of the return value | |
567 | # which is useful when ensuring a command fails as desired. | |
568 | # I.e., just doing `command ... &&fail=1` will not catch | |
569 | # a segfault in command for example. With this helper you | |
570 | # instead check an explicit exit code like | |
571 | # returns_ 1 command ... || fail | |
572 | returns_ () { | |
573 | # Disable tracing so it doesn't interfere with stderr of the wrapped command | |
574 | { set +x; } 2>/dev/null | |
575 | ||
576 | local exp_exit="$1" | |
577 | shift | |
578 | "$@" | |
579 | test $? -eq $exp_exit && ret_=0 || ret_=1 | |
580 | ||
581 | if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then | |
582 | set -x | |
583 | fi | |
584 | { return $ret_; } 2>/dev/null | |
585 | } | |
586 | ||
587 | # ----------------------------------------------------------------------------- | |
588 | # Text file comparison | |
589 | ||
590 | # Emit a header similar to that from diff -u; Print the simulated "diff" | |
591 | # command so that the order of arguments is clear. Don't bother with @@ lines. | |
592 | emit_diff_u_header_ () | |
593 | { | |
594 | printf '%s\n' "diff -u $*" \ | |
595 | "--- $1 1970-01-01" \ | |
596 | "+++ $2 1970-01-01" | |
597 | } | |
598 | ||
599 | # Arrange not to let diff or cmp operate on /dev/null, | |
600 | # since on some systems (at least OSF/1 5.1), that doesn't work. | |
601 | # When there are not two arguments, or no argument is /dev/null, return 2. | |
602 | # When one argument is /dev/null and the other is not empty, | |
603 | # cat the nonempty file to stderr and return 1. | |
604 | # Otherwise, return 0. | |
605 | compare_dev_null_ () | |
606 | { | |
607 | test $# = 2 || return 2 | |
608 | ||
609 | if test "x$1" = x/dev/null; then | |
610 | test -s "$2" || return 0 | |
611 | emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" | |
612 | return 1 | |
613 | fi | |
614 | ||
615 | if test "x$2" = x/dev/null; then | |
616 | test -s "$1" || return 0 | |
617 | emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" | |
618 | return 1 | |
619 | fi | |
620 | ||
621 | return 2 | |
622 | } | |
623 | ||
624 | for diff_opt_ in -u -U3 -c '' no; do | |
625 | test "$diff_opt_" != no && | |
626 | diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && | |
627 | break | |
628 | done | |
629 | if test "$diff_opt_" != no; then | |
630 | if test -z "$diff_out_"; then | |
631 | compare_ () { diff $diff_opt_ "$@"; } | |
632 | else | |
633 | compare_ () | |
634 | { | |
635 | # If no differences were found, AIX and HP-UX 'diff' produce output | |
636 | # like "No differences encountered". Hide this output. | |
637 | diff $diff_opt_ "$@" > diff.out | |
638 | diff_status_=$? | |
639 | test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 | |
640 | rm -f diff.out || diff_status_=2 | |
641 | return $diff_status_ | |
642 | } | |
643 | fi | |
644 | elif cmp -s /dev/null /dev/null 2>/dev/null; then | |
645 | compare_ () { cmp -s "$@"; } | |
646 | else | |
647 | compare_ () { cmp "$@"; } | |
648 | fi | |
649 | ||
650 | # Usage: compare EXPECTED ACTUAL | |
651 | # | |
652 | # Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. | |
653 | # Otherwise, propagate $? to caller: any diffs have already been printed. | |
654 | compare () | |
655 | { | |
656 | # This looks like it can be factored to use a simple "case $?" | |
657 | # after unchecked compare_dev_null_ invocation, but that would | |
658 | # fail in a "set -e" environment. | |
659 | if compare_dev_null_ "$@"; then | |
660 | return 0 | |
661 | else | |
662 | case $? in | |
663 | 1) return 1;; | |
664 | *) compare_ "$@";; | |
665 | esac | |
666 | fi | |
667 | } | |
668 | ||
669 | # ----------------------------------------------------------------------------- | |
608 | 670 | |
609 | 671 | # If you want to override the testdir_prefix_ function, |
610 | 672 | # or to add more utility functions, use this file. |
611 | 673 | test -f "$srcdir/init.cfg" \ |
612 | 674 | && . "$srcdir/init.cfg" |
613 | 675 | |
676 | # ============================================================================= | |
677 | # Set up the environment for the test to run in. | |
678 | ||
614 | 679 | setup_ "$@" |
615 | 680 | # This trap is here, rather than in the setup_ function, because some |
616 | 681 | # shells run the exit trap at shell function exit, rather than script exit. |
0 | 0 | /* intprops.h -- properties of integer types |
1 | 1 | |
2 | Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software: you can redistribute it and/or modify it |
5 | 5 | under the terms of the GNU General Public License as published |
21 | 21 | |
22 | 22 | #include <limits.h> |
23 | 23 | |
24 | /* Return a value with the common real type of E and V and the value of V. */ | |
25 | #define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) | |
24 | /* Return a value with the common real type of E and V and the value of V. | |
25 | Do not evaluate E. */ | |
26 | #define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v)) | |
26 | 27 | |
27 | 28 | /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see |
28 | 29 | <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */ |
29 | #define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) | |
30 | #define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v)) | |
30 | 31 | |
31 | 32 | /* The extra casts in the following macros work around compiler bugs, |
32 | 33 | e.g., in Cray C 5.0.3.0. */ |
39 | 40 | #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) |
40 | 41 | |
41 | 42 | /* Return 1 if the real expression E, after promotion, has a |
42 | signed or floating type. */ | |
43 | signed or floating type. Do not evaluate E. */ | |
43 | 44 | #define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) |
44 | 45 | |
45 | 46 | |
46 | 47 | /* Minimum and maximum values for integer types and expressions. */ |
47 | 48 | |
48 | 49 | /* The width in bits of the integer type or expression T. |
50 | Do not evaluate T. | |
49 | 51 | Padding bits are not supported; this is checked at compile-time below. */ |
50 | 52 | #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) |
51 | 53 | |
57 | 59 | : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) |
58 | 60 | |
59 | 61 | /* The maximum and minimum values for the type of the expression E, |
60 | after integer promotion. E should not have side effects. */ | |
62 | after integer promotion. E is not evaluated. */ | |
61 | 63 | #define _GL_INT_MINIMUM(e) \ |
62 | 64 | (EXPR_SIGNED (e) \ |
63 | 65 | ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ |
108 | 110 | Subtract 1 for the sign bit if T is signed, and then add 1 more for |
109 | 111 | a minus sign if needed. |
110 | 112 | |
111 | Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is | |
112 | signed, this macro may overestimate the true bound by one byte when | |
113 | Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 1 when its argument is | |
114 | unsigned, this macro may overestimate the true bound by one byte when | |
113 | 115 | applied to unsigned types of size 2, 4, 16, ... bytes. */ |
114 | 116 | #define INT_STRLEN_BOUND(t) \ |
115 | 117 | (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ |
217 | 219 | ? (a) < (min) >> (b) \ |
218 | 220 | : (max) >> (b) < (a)) |
219 | 221 | |
220 | /* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ | |
222 | /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow | |
223 | (A, B, P) work when P is non-null. */ | |
221 | 224 | #if 5 <= __GNUC__ && !defined __ICC |
222 | # define _GL_HAS_BUILTIN_OVERFLOW 1 | |
223 | #else | |
224 | # define _GL_HAS_BUILTIN_OVERFLOW 0 | |
225 | #endif | |
226 | ||
227 | /* True if __builtin_add_overflow_p (A, B, C) works. */ | |
225 | # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 | |
226 | #elif defined __has_builtin | |
227 | # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) | |
228 | #else | |
229 | # define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 | |
230 | #endif | |
231 | ||
232 | /* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */ | |
233 | #ifdef __clang__ | |
234 | /* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */ | |
235 | # define _GL_HAS_BUILTIN_MUL_OVERFLOW 0 | |
236 | #else | |
237 | # define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW | |
238 | #endif | |
239 | ||
240 | /* True if __builtin_add_overflow_p (A, B, C) works, and similarly for | |
241 | __builtin_mul_overflow_p and __builtin_mul_overflow_p. */ | |
228 | 242 | #define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) |
229 | 243 | |
230 | 244 | /* The _GL*_OVERFLOW macros have the same restrictions as the |
278 | 292 | |
279 | 293 | The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators |
280 | 294 | might not yield numerically correct answers due to arithmetic overflow. |
281 | The INT_<op>_WRAPV macros also store the low-order bits of the answer. | |
295 | The INT_<op>_WRAPV macros compute the low-order bits of the sum, | |
296 | difference, and product of two C integers, and return 1 if these | |
297 | low-order bits are not numerically correct. | |
282 | 298 | These macros work correctly on all known practical hosts, and do not rely |
283 | 299 | on undefined behavior due to signed arithmetic overflow. |
284 | 300 | |
306 | 322 | arguments should not have side effects. |
307 | 323 | |
308 | 324 | The WRAPV macros are not constant expressions. They support only |
309 | +, binary -, and *. The result type must be signed. | |
310 | ||
311 | These macros are tuned for their last argument being a constant. | |
325 | +, binary -, and *. Because the WRAPV macros convert the result, | |
326 | they report overflow in different circumstances than the OVERFLOW | |
327 | macros do. | |
328 | ||
329 | These macros are tuned for their last input argument being a constant. | |
312 | 330 | |
313 | 331 | Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B, |
314 | 332 | A % B, and A << B would overflow, respectively. */ |
339 | 357 | Arguments should be free of side effects. */ |
340 | 358 | #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ |
341 | 359 | op_result_overflow (a, b, \ |
342 | _GL_INT_MINIMUM (0 * (b) + (a)), \ | |
343 | _GL_INT_MAXIMUM (0 * (b) + (a))) | |
360 | _GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \ | |
361 | _GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b))) | |
344 | 362 | |
345 | 363 | /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. |
346 | 364 | Return 1 if the result overflows. See above for restrictions. */ |
347 | #define INT_ADD_WRAPV(a, b, r) \ | |
348 | _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW) | |
349 | #define INT_SUBTRACT_WRAPV(a, b, r) \ | |
350 | _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW) | |
351 | #define INT_MULTIPLY_WRAPV(a, b, r) \ | |
352 | _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) | |
365 | #if _GL_HAS_BUILTIN_ADD_OVERFLOW | |
366 | # define INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r) | |
367 | # define INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r) | |
368 | #else | |
369 | # define INT_ADD_WRAPV(a, b, r) \ | |
370 | _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW) | |
371 | # define INT_SUBTRACT_WRAPV(a, b, r) \ | |
372 | _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW) | |
373 | #endif | |
374 | #if _GL_HAS_BUILTIN_MUL_OVERFLOW | |
375 | # if (9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ | |
376 | || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) | |
377 | # define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r) | |
378 | # else | |
379 | /* Work around GCC bug 91450. */ | |
380 | # define INT_MULTIPLY_WRAPV(a, b, r) \ | |
381 | ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \ | |
382 | && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \ | |
383 | ? ((void) __builtin_mul_overflow (a, b, r), 1) \ | |
384 | : __builtin_mul_overflow (a, b, r)) | |
385 | # endif | |
386 | #else | |
387 | # define INT_MULTIPLY_WRAPV(a, b, r) \ | |
388 | _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW) | |
389 | #endif | |
353 | 390 | |
354 | 391 | /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: |
355 | 392 | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 |
356 | 393 | https://llvm.org/bugs/show_bug.cgi?id=25390 |
357 | 394 | For now, assume all versions of GCC-like compilers generate bogus |
358 | warnings for _Generic. This matters only for older compilers that | |
359 | lack __builtin_add_overflow. */ | |
395 | warnings for _Generic. This matters only for compilers that | |
396 | lack relevant builtins. */ | |
360 | 397 | #if __GNUC__ |
361 | 398 | # define _GL__GENERIC_BOGUS 1 |
362 | 399 | #else |
364 | 401 | #endif |
365 | 402 | |
366 | 403 | /* Store the low-order bits of A <op> B into *R, where OP specifies |
367 | the operation. BUILTIN is the builtin operation, and OVERFLOW the | |
368 | overflow predicate. Return 1 if the result overflows. See above | |
369 | for restrictions. */ | |
370 | #if _GL_HAS_BUILTIN_OVERFLOW | |
371 | # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) | |
372 | #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS | |
373 | # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ | |
404 | the operation and OVERFLOW the overflow predicate. Return 1 if the | |
405 | result overflows. See above for restrictions. */ | |
406 | #if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS | |
407 | # define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \ | |
374 | 408 | (_Generic \ |
375 | 409 | (*(r), \ |
376 | 410 | signed char: \ |
377 | 411 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ |
378 | 412 | signed char, SCHAR_MIN, SCHAR_MAX), \ |
413 | unsigned char: \ | |
414 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
415 | unsigned char, 0, UCHAR_MAX), \ | |
379 | 416 | short int: \ |
380 | 417 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ |
381 | 418 | short int, SHRT_MIN, SHRT_MAX), \ |
419 | unsigned short int: \ | |
420 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
421 | unsigned short int, 0, USHRT_MAX), \ | |
382 | 422 | int: \ |
383 | 423 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ |
384 | 424 | int, INT_MIN, INT_MAX), \ |
425 | unsigned int: \ | |
426 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
427 | unsigned int, 0, UINT_MAX), \ | |
385 | 428 | long int: \ |
386 | 429 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ |
387 | 430 | long int, LONG_MIN, LONG_MAX), \ |
431 | unsigned long int: \ | |
432 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ | |
433 | unsigned long int, 0, ULONG_MAX), \ | |
388 | 434 | long long int: \ |
389 | 435 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ |
390 | long long int, LLONG_MIN, LLONG_MAX))) | |
391 | #else | |
392 | # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ | |
436 | long long int, LLONG_MIN, LLONG_MAX), \ | |
437 | unsigned long long int: \ | |
438 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ | |
439 | unsigned long long int, 0, ULLONG_MAX))) | |
440 | #else | |
441 | /* Store the low-order bits of A <op> B into *R, where OP specifies | |
442 | the operation and OVERFLOW the overflow predicate. If *R is | |
443 | signed, its type is ST with bounds SMIN..SMAX; otherwise its type | |
444 | is UT with bounds U..UMAX. ST and UT are narrower than int. | |
445 | Return 1 if the result overflows. See above for restrictions. */ | |
446 | # if _GL_HAVE___TYPEOF__ | |
447 | # define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \ | |
448 | (TYPE_SIGNED (__typeof__ (*(r))) \ | |
449 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \ | |
450 | : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax)) | |
451 | # else | |
452 | # define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \ | |
453 | (overflow (a, b, smin, smax) \ | |
454 | ? (overflow (a, b, 0, umax) \ | |
455 | ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \ | |
456 | : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \ | |
457 | : (overflow (a, b, 0, umax) \ | |
458 | ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \ | |
459 | : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0))) | |
460 | # endif | |
461 | ||
462 | # define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \ | |
393 | 463 | (sizeof *(r) == sizeof (signed char) \ |
394 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
395 | signed char, SCHAR_MIN, SCHAR_MAX) \ | |
464 | ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \ | |
465 | signed char, SCHAR_MIN, SCHAR_MAX, \ | |
466 | unsigned char, UCHAR_MAX) \ | |
396 | 467 | : sizeof *(r) == sizeof (short int) \ |
397 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
398 | short int, SHRT_MIN, SHRT_MAX) \ | |
468 | ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \ | |
469 | short int, SHRT_MIN, SHRT_MAX, \ | |
470 | unsigned short int, USHRT_MAX) \ | |
399 | 471 | : sizeof *(r) == sizeof (int) \ |
400 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
401 | int, INT_MIN, INT_MAX) \ | |
472 | ? (EXPR_SIGNED (*(r)) \ | |
473 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
474 | int, INT_MIN, INT_MAX) \ | |
475 | : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ | |
476 | unsigned int, 0, UINT_MAX)) \ | |
402 | 477 | : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow)) |
403 | 478 | # ifdef LLONG_MAX |
404 | 479 | # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ |
405 | 480 | (sizeof *(r) == sizeof (long int) \ |
481 | ? (EXPR_SIGNED (*(r)) \ | |
482 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ | |
483 | long int, LONG_MIN, LONG_MAX) \ | |
484 | : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ | |
485 | unsigned long int, 0, ULONG_MAX)) \ | |
486 | : (EXPR_SIGNED (*(r)) \ | |
487 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ | |
488 | long long int, LLONG_MIN, LLONG_MAX) \ | |
489 | : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ | |
490 | unsigned long long int, 0, ULLONG_MAX))) | |
491 | # else | |
492 | # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ | |
493 | (EXPR_SIGNED (*(r)) \ | |
406 | 494 | ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ |
407 | 495 | long int, LONG_MIN, LONG_MAX) \ |
408 | : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ | |
409 | long long int, LLONG_MIN, LLONG_MAX)) | |
410 | # else | |
411 | # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ | |
412 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ | |
413 | long int, LONG_MIN, LONG_MAX) | |
496 | : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ | |
497 | unsigned long int, 0, ULONG_MAX)) | |
414 | 498 | # endif |
415 | 499 | #endif |
416 | 500 | |
419 | 503 | overflow problems. *R's type is T, with extrema TMIN and TMAX. |
420 | 504 | T must be a signed integer type. Return 1 if the result overflows. */ |
421 | 505 | #define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \ |
422 | (sizeof ((a) op (b)) < sizeof (t) \ | |
423 | ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \ | |
424 | : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax)) | |
425 | #define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \ | |
426 | ((overflow (a, b) \ | |
427 | || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \ | |
428 | || (tmax) < ((a) op (b))) \ | |
506 | (overflow (a, b, tmin, tmax) \ | |
429 | 507 | ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \ |
430 | 508 | : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0)) |
431 | 509 | |
449 | 527 | #define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \ |
450 | 528 | ((t) ((ut) (a) op (ut) (b))) |
451 | 529 | |
530 | /* Return true if the numeric values A + B, A - B, A * B fall outside | |
531 | the range TMIN..TMAX. Arguments should be integer expressions | |
532 | without side effects. TMIN should be signed and nonpositive. | |
533 | TMAX should be positive, and should be signed unless TMIN is zero. */ | |
534 | #define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \ | |
535 | ((b) < 0 \ | |
536 | ? (((tmin) \ | |
537 | ? ((EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \ | |
538 | && (a) < (tmin) - (b)) \ | |
539 | : (a) <= -1 - (b)) \ | |
540 | || ((EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \ | |
541 | : (a) < 0 \ | |
542 | ? (((tmin) \ | |
543 | ? ((EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \ | |
544 | && (b) < (tmin) - (a)) \ | |
545 | : (b) <= -1 - (a)) \ | |
546 | || ((EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \ | |
547 | && (tmax) < (a) + (b))) \ | |
548 | : (tmax) < (b) || (tmax) - (b) < (a)) | |
549 | #define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \ | |
550 | (((a) < 0) == ((b) < 0) \ | |
551 | ? ((a) < (b) \ | |
552 | ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \ | |
553 | : (tmax) < (a) - (b)) \ | |
554 | : (a) < 0 \ | |
555 | ? ((!EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \ | |
556 | || (a) - (tmin) < (b)) \ | |
557 | : ((! (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \ | |
558 | && EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \ | |
559 | && (tmax) <= -1 - (b)) \ | |
560 | || (tmax) + (b) < (a))) | |
561 | #define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \ | |
562 | ((b) < 0 \ | |
563 | ? ((a) < 0 \ | |
564 | ? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \ | |
565 | ? (a) < (tmax) / (b) \ | |
566 | : ((INT_NEGATE_OVERFLOW (b) \ | |
567 | ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (b) - 1) \ | |
568 | : (tmax) / -(b)) \ | |
569 | <= -1 - (a))) \ | |
570 | : INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \ | |
571 | ? (EXPR_SIGNED (a) \ | |
572 | ? 0 < (a) + (tmin) \ | |
573 | : 0 < (a) && -1 - (tmin) < (a) - 1) \ | |
574 | : (tmin) / (b) < (a)) \ | |
575 | : (b) == 0 \ | |
576 | ? 0 \ | |
577 | : ((a) < 0 \ | |
578 | ? (INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \ | |
579 | ? (EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \ | |
580 | : (tmin) / (a) < (b)) \ | |
581 | : (tmax) / (b) < (a))) | |
582 | ||
452 | 583 | #endif /* _GL_INTPROPS_H */ |
0 | /* Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
0 | /* Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
1 | 1 | Written by Paul Eggert, Bruno Haible, Derek Price. |
2 | 2 | This file is part of gnulib. |
3 | 3 | |
16 | 16 | |
17 | 17 | /* |
18 | 18 | * ISO C 99 <inttypes.h> for platforms that lack it. |
19 | * <http://www.opengroup.org/susv3xbd/inttypes.h.html> | |
19 | * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html> | |
20 | 20 | */ |
21 | 21 | |
22 | 22 | #if __GNUC__ >= 3 |
37 | 37 | # endif |
38 | 38 | |
39 | 39 | # @INCLUDE_NEXT@ @NEXT_INTTYPES_H@ |
40 | ||
41 | # define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H | |
40 | 42 | # endif |
41 | 43 | #endif |
42 | 44 | |
48 | 50 | #ifndef __GLIBC__ |
49 | 51 | # include <stdint.h> |
50 | 52 | #endif |
51 | /* Get CHAR_BIT. */ | |
53 | /* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */ | |
52 | 54 | #include <limits.h> |
53 | 55 | /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */ |
54 | 56 | #if defined _WIN32 && ! defined __CYGWIN__ |
55 | 57 | # include <stdio.h> |
56 | 58 | #endif |
57 | 59 | |
58 | #if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX) | |
59 | # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>." | |
60 | #if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1) | |
61 | # error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <bug-gnulib@gnu.org>." | |
60 | 62 | #endif |
61 | 63 | |
62 | 64 | /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
188 | 190 | # define _PRI64_PREFIX "l" |
189 | 191 | # elif defined _MSC_VER || defined __MINGW32__ |
190 | 192 | # define _PRI64_PREFIX "I64" |
191 | # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 | |
193 | # elif LONG_MAX >> 30 == 1 | |
192 | 194 | # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX |
193 | 195 | # endif |
194 | 196 | # if !defined PRId64 || @PRI_MACROS_BROKEN@ |
205 | 207 | # define _PRIu64_PREFIX "l" |
206 | 208 | # elif defined _MSC_VER || defined __MINGW32__ |
207 | 209 | # define _PRIu64_PREFIX "I64" |
208 | # elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 | |
210 | # elif ULONG_MAX >> 31 == 1 | |
209 | 211 | # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX |
210 | 212 | # endif |
211 | 213 | # if !defined PRIo64 || @PRI_MACROS_BROKEN@ |
681 | 683 | # define _SCN64_PREFIX "l" |
682 | 684 | # elif defined _MSC_VER || defined __MINGW32__ |
683 | 685 | # define _SCN64_PREFIX "I64" |
684 | # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 | |
686 | # elif LONG_MAX >> 30 == 1 | |
685 | 687 | # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX |
686 | 688 | # endif |
687 | 689 | # if !defined SCNd64 || @PRI_MACROS_BROKEN@ |
698 | 700 | # define _SCNu64_PREFIX "l" |
699 | 701 | # elif defined _MSC_VER || defined __MINGW32__ |
700 | 702 | # define _SCNu64_PREFIX "I64" |
701 | # elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 | |
703 | # elif ULONG_MAX >> 31 == 1 | |
702 | 704 | # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX |
703 | 705 | # endif |
704 | 706 | # if !defined SCNo64 || @PRI_MACROS_BROKEN@ |
1090 | 1092 | # define strtoimax rpl_strtoimax |
1091 | 1093 | # endif |
1092 | 1094 | _GL_FUNCDECL_RPL (strtoimax, intmax_t, |
1093 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); | |
1094 | _GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int)); | |
1095 | (const char *restrict, char **restrict, int) | |
1096 | _GL_ARG_NONNULL ((1))); | |
1097 | _GL_CXXALIAS_RPL (strtoimax, intmax_t, | |
1098 | (const char *restrict, char **restrict, int)); | |
1095 | 1099 | # else |
1096 | 1100 | # if !@HAVE_DECL_STRTOIMAX@ |
1097 | 1101 | # undef strtoimax |
1098 | 1102 | _GL_FUNCDECL_SYS (strtoimax, intmax_t, |
1099 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); | |
1103 | (const char *restrict, char **restrict, int) | |
1104 | _GL_ARG_NONNULL ((1))); | |
1100 | 1105 | # endif |
1101 | _GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int)); | |
1106 | _GL_CXXALIAS_SYS (strtoimax, intmax_t, | |
1107 | (const char *restrict, char **restrict, int)); | |
1102 | 1108 | # endif |
1103 | 1109 | _GL_CXXALIASWARN (strtoimax); |
1104 | 1110 | #elif defined GNULIB_POSIXCHECK |
1116 | 1122 | # define strtoumax rpl_strtoumax |
1117 | 1123 | # endif |
1118 | 1124 | _GL_FUNCDECL_RPL (strtoumax, uintmax_t, |
1119 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); | |
1120 | _GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int)); | |
1125 | (const char *restrict, char **restrict, int) | |
1126 | _GL_ARG_NONNULL ((1))); | |
1127 | _GL_CXXALIAS_RPL (strtoumax, uintmax_t, | |
1128 | (const char *restrict, char **restrict, int)); | |
1121 | 1129 | # else |
1122 | 1130 | # if !@HAVE_DECL_STRTOUMAX@ |
1123 | 1131 | # undef strtoumax |
1124 | 1132 | _GL_FUNCDECL_SYS (strtoumax, uintmax_t, |
1125 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); | |
1133 | (const char *restrict, char **restrict, int) | |
1134 | _GL_ARG_NONNULL ((1))); | |
1126 | 1135 | # endif |
1127 | _GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); | |
1136 | _GL_CXXALIAS_SYS (strtoumax, uintmax_t, | |
1137 | (const char *restrict, char **restrict, int)); | |
1128 | 1138 | # endif |
1129 | 1139 | _GL_CXXALIASWARN (strtoumax); |
1130 | 1140 | #elif defined GNULIB_POSIXCHECK |
0 | 0 | /* Common macros used by gnulib tests. |
1 | Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Macro for checking that a function declaration is compliant. |
1 | Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of <byteswap.h> substitute. |
1 | Copyright (C) 2007-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2007-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* |
1 | * Copyright (C) 2005, 2007, 2010-2018 Free Software Foundation, Inc. | |
1 | * Copyright (C) 2005, 2007, 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | * Written by Simon Josefsson |
3 | 3 | * |
4 | 4 | * This program is free software; you can redistribute it and/or modify |
0 | 0 | #!/bin/sh |
1 | 1 | # Unit tests for init.sh |
2 | # Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
3 | 3 | # This file is part of the GNUlib Library. |
4 | 4 | # |
5 | 5 | # This program is free software: you can redistribute it and/or modify |
0 | 0 | /* Test intprops.h. |
1 | Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
37 | 37 | #include <limits.h> |
38 | 38 | |
39 | 39 | #include "macros.h" |
40 | ||
41 | /* Compile-time verification of expression X. | |
42 | In this file, we need it as a statement, rather than as a declaration. */ | |
43 | #define verify_stmt(x) do { verify (x); } while (0) | |
40 | 44 | |
41 | 45 | /* VERIFY (X) uses a static assertion for compilers that are known to work, |
42 | 46 | and falls back on a dynamic assertion for other compilers. |
44 | 48 | using 'verify' would run into a bug with HP-UX 11.23 cc; see |
45 | 49 | <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>. */ |
46 | 50 | #if __GNUC__ || __SUNPRO_C |
47 | # define VERIFY(x) do { verify (x); } while (0) | |
51 | # define VERIFY(x) verify_stmt (x) | |
48 | 52 | #else |
49 | 53 | # define VERIFY(x) ASSERT (x) |
50 | 54 | #endif |
51 | 55 | |
52 | 56 | #define DONTCARE __LINE__ |
57 | ||
58 | int int_minus_2 = -2; | |
59 | int int_1 = 1; | |
53 | 60 | |
54 | 61 | int |
55 | 62 | main (void) |
113 | 120 | VERIFY (TYPE_MINIMUM (unsigned long int) == 0); |
114 | 121 | VERIFY (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX); |
115 | 122 | #ifdef LLONG_MAX |
116 | verify (TYPE_MINIMUM (long long int) == LLONG_MIN); | |
117 | verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | |
123 | verify_stmt (TYPE_MINIMUM (long long int) == LLONG_MIN); | |
124 | verify_stmt (TYPE_MAXIMUM (long long int) == LLONG_MAX); | |
125 | verify_stmt (TYPE_MINIMUM (unsigned long long int) == 0); | |
126 | verify_stmt (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX); | |
118 | 127 | #endif |
119 | 128 | VERIFY (TYPE_MINIMUM (intmax_t) == INTMAX_MIN); |
120 | 129 | VERIFY (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX); |
123 | 132 | |
124 | 133 | /* TYPE_WIDTH. */ |
125 | 134 | #ifdef CHAR_WIDTH |
126 | verify (TYPE_WIDTH (char) == CHAR_WIDTH); | |
127 | verify (TYPE_WIDTH (signed char) == SCHAR_WIDTH); | |
128 | verify (TYPE_WIDTH (unsigned char) == UCHAR_WIDTH); | |
129 | verify (TYPE_WIDTH (short int) == SHRT_WIDTH); | |
130 | verify (TYPE_WIDTH (unsigned short int) == USHRT_WIDTH); | |
131 | verify (TYPE_WIDTH (int) == INT_WIDTH); | |
132 | verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); | |
133 | verify (TYPE_WIDTH (long int) == LONG_WIDTH); | |
134 | verify (TYPE_WIDTH (unsigned long int) == ULONG_WIDTH); | |
135 | verify_stmt (TYPE_WIDTH (char) == CHAR_WIDTH); | |
136 | verify_stmt (TYPE_WIDTH (signed char) == SCHAR_WIDTH); | |
137 | verify_stmt (TYPE_WIDTH (unsigned char) == UCHAR_WIDTH); | |
138 | verify_stmt (TYPE_WIDTH (short int) == SHRT_WIDTH); | |
139 | verify_stmt (TYPE_WIDTH (unsigned short int) == USHRT_WIDTH); | |
140 | verify_stmt (TYPE_WIDTH (int) == INT_WIDTH); | |
141 | verify_stmt (TYPE_WIDTH (unsigned int) == UINT_WIDTH); | |
142 | verify_stmt (TYPE_WIDTH (long int) == LONG_WIDTH); | |
143 | verify_stmt (TYPE_WIDTH (unsigned long int) == ULONG_WIDTH); | |
135 | 144 | #ifdef LLONG_WIDTH |
136 | verify (TYPE_WIDTH (long long int) == LLONG_WIDTH); | |
137 | verify (TYPE_WIDTH (unsigned long long int) == ULLONG_WIDTH); | |
145 | verify_stmt (TYPE_WIDTH (long long int) == LLONG_WIDTH); | |
146 | verify_stmt (TYPE_WIDTH (unsigned long long int) == ULLONG_WIDTH); | |
138 | 147 | #endif |
139 | 148 | #endif |
140 | 149 | |
208 | 217 | CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MIN, int, true, 0); |
209 | 218 | CHECK_SBINOP (*, MULTIPLY, -1, INT_MIN, int, |
210 | 219 | INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN); |
220 | #if !defined __HP_cc | |
211 | 221 | CHECK_SBINOP (*, MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX, |
212 | 222 | long int, false, LONG_MIN - LONG_MIN % INT_MAX); |
223 | #endif | |
213 | 224 | |
214 | 225 | CHECK_BINOP (/, DIVIDE, INT_MIN, -1, int, |
215 | 226 | INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN); |
230 | 241 | |
231 | 242 | /* INT_<op>_OVERFLOW and INT_<op>_WRAPV with mixed types. */ |
232 | 243 | #define CHECK_SUM(a, b, t, v, vres) \ |
233 | CHECK_SUM1(a, b, t, v, vres); \ | |
234 | CHECK_SUM1(b, a, t, v, vres) | |
235 | #define CHECK_SSUM(a, b, t, v, vres) \ | |
236 | CHECK_SSUM1(a, b, t, v, vres); \ | |
237 | CHECK_SSUM1(b, a, t, v, vres) | |
244 | CHECK_SUM1 (a, b, t, v, vres); \ | |
245 | CHECK_SUM1 (b, a, t, v, vres) | |
246 | #define CHECK_SUM_WRAPV(a, b, t, v, vres, okres) \ | |
247 | CHECK_SUM_WRAPV1 (a, b, t, v, vres, okres); \ | |
248 | CHECK_SUM_WRAPV1 (b, a, t, v, vres, okres) | |
238 | 249 | #define CHECK_SUM1(a, b, t, v, vres) \ |
239 | VERIFY (INT_ADD_OVERFLOW (a, b) == (v)) | |
240 | #define CHECK_SSUM1(a, b, t, v, vres) \ | |
241 | CHECK_SUM1(a, b, t, v, vres); \ | |
250 | VERIFY (INT_ADD_OVERFLOW (a, b) == (v)); \ | |
251 | CHECK_SUM_WRAPV1 (a, b, t, v, vres, (a) + (b)) | |
252 | #define CHECK_SUM_WRAPV1(a, b, t, v, vres, okres) \ | |
242 | 253 | { \ |
243 | 254 | t result; \ |
244 | 255 | ASSERT (INT_ADD_WRAPV (a, b, &result) == (v)); \ |
245 | ASSERT (result == ((v) ? (vres) : ((a) + (b)))); \ | |
256 | ASSERT (result == ((v) ? (vres) : (okres))); \ | |
246 | 257 | } |
247 | CHECK_SSUM (-1, LONG_MIN, long int, true, LONG_MAX); | |
258 | CHECK_SUM (-1, LONG_MIN, long int, true, LONG_MAX); | |
248 | 259 | CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE); |
249 | CHECK_SSUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN, | |
260 | CHECK_SUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN, | |
250 | 261 | INT_MIN == LONG_MIN ? INT_MAX : DONTCARE); |
251 | 262 | CHECK_SUM (0u, -1, unsigned int, true, 0u + -1); |
252 | 263 | CHECK_SUM (0u, 0, unsigned int, false, DONTCARE); |
253 | 264 | CHECK_SUM (0u, 1, unsigned int, false, DONTCARE); |
254 | CHECK_SSUM (1, LONG_MAX, long int, true, LONG_MIN); | |
265 | CHECK_SUM (1, LONG_MAX, long int, true, LONG_MIN); | |
255 | 266 | CHECK_SUM (1, UINT_MAX, unsigned int, true, 0u); |
256 | CHECK_SSUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX, | |
267 | CHECK_SUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX, | |
257 | 268 | INT_MAX == LONG_MAX ? INT_MIN : DONTCARE); |
258 | 269 | CHECK_SUM (1u, INT_MAX, unsigned int, INT_MAX == UINT_MAX, 1u + INT_MAX); |
259 | 270 | CHECK_SUM (1u, INT_MIN, unsigned int, true, 1u + INT_MIN); |
271 | CHECK_SUM_WRAPV (-1, 1u, int, false, DONTCARE, 0); | |
272 | CHECK_SUM_WRAPV (-1, 1ul, int, false, DONTCARE, 0); | |
273 | CHECK_SUM_WRAPV (-1l, 1u, int, false, DONTCARE, 0); | |
274 | CHECK_SUM_WRAPV (-100, 1000u, int, false, DONTCARE, 900); | |
275 | CHECK_SUM_WRAPV (INT_MIN, UINT_MAX, int, false, DONTCARE, INT_MAX); | |
276 | CHECK_SUM_WRAPV (1u, INT_MAX, int, true, INT_MIN, DONTCARE); | |
277 | CHECK_SUM_WRAPV (INT_MAX, 1, long int, LONG_MAX <= INT_MAX, INT_MIN, | |
278 | INT_MAX + 1L); | |
279 | CHECK_SUM_WRAPV (UINT_MAX, 1, long int, LONG_MAX <= UINT_MAX, 0, | |
280 | UINT_MAX + 1L); | |
281 | CHECK_SUM_WRAPV (INT_MAX, 1, unsigned long int, ULONG_MAX <= INT_MAX, 0, | |
282 | INT_MAX + 1uL); | |
283 | CHECK_SUM_WRAPV (UINT_MAX, 1, unsigned long int, ULONG_MAX <= UINT_MAX, 0, | |
284 | UINT_MAX + 1uL); | |
285 | ||
260 | 286 | { |
261 | 287 | long int result; |
262 | 288 | ASSERT (INT_ADD_WRAPV (1, INT_MAX, &result) == (INT_MAX == LONG_MAX)); |
266 | 292 | #define CHECK_DIFFERENCE(a, b, t, v, vres) \ |
267 | 293 | VERIFY (INT_SUBTRACT_OVERFLOW (a, b) == (v)) |
268 | 294 | #define CHECK_SDIFFERENCE(a, b, t, v, vres) \ |
269 | CHECK_DIFFERENCE(a, b, t, v, vres); \ | |
295 | CHECK_DIFFERENCE (a, b, t, v, vres); \ | |
296 | CHECK_SDIFFERENCE_WRAPV (a, b, t, v, vres) | |
297 | #define CHECK_SDIFFERENCE_WRAPV(a, b, t, v, vres) \ | |
270 | 298 | { \ |
271 | 299 | t result; \ |
272 | 300 | ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v)); \ |
283 | 311 | CHECK_SDIFFERENCE (-1, INT_MAX, int, false, -1 - INT_MAX); |
284 | 312 | CHECK_SDIFFERENCE (0, INT_MIN, int, INT_MIN < -INT_MAX, INT_MIN); |
285 | 313 | CHECK_SDIFFERENCE (0, INT_MAX, int, false, 0 - INT_MAX); |
314 | CHECK_SDIFFERENCE_WRAPV (-1, 1u, int, false, DONTCARE); | |
315 | CHECK_SDIFFERENCE_WRAPV (-1, 1ul, int, false, DONTCARE); | |
316 | CHECK_SDIFFERENCE_WRAPV (-1l, 1u, int, false, DONTCARE); | |
317 | CHECK_SDIFFERENCE_WRAPV (0u, INT_MAX, int, false, DONTCARE); | |
318 | CHECK_SDIFFERENCE_WRAPV (1u, INT_MIN, int, true, 1u - INT_MIN); | |
286 | 319 | { |
287 | 320 | long int result; |
288 | 321 | ASSERT (INT_SUBTRACT_WRAPV (INT_MAX, -1, &result) == (INT_MAX == LONG_MAX)); |
290 | 323 | } |
291 | 324 | |
292 | 325 | #define CHECK_PRODUCT(a, b, t, v, vres) \ |
293 | CHECK_PRODUCT1(a, b, t, v, vres); \ | |
294 | CHECK_PRODUCT1(b, a, t, v, vres) | |
326 | CHECK_PRODUCT1 (a, b, t, v, vres); \ | |
327 | CHECK_PRODUCT1 (b, a, t, v, vres) | |
295 | 328 | #define CHECK_SPRODUCT(a, b, t, v, vres) \ |
296 | CHECK_SPRODUCT1(a, b, t, v, vres); \ | |
297 | CHECK_SPRODUCT1(b, a, t, v, vres) | |
329 | CHECK_SPRODUCT1 (a, b, t, v, vres); \ | |
330 | CHECK_SPRODUCT1 (b, a, t, v, vres) | |
331 | #define CHECK_SPRODUCT_WRAPV(a, b, t, v, vres) \ | |
332 | CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres); \ | |
333 | CHECK_SPRODUCT_WRAPV1 (b, a, t, v, vres) | |
298 | 334 | #define CHECK_PRODUCT1(a, b, t, v, vres) \ |
299 | 335 | VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (v)) |
300 | 336 | #define CHECK_SPRODUCT1(a, b, t, v, vres) \ |
301 | CHECK_PRODUCT1(a, b, t, v, vres); \ | |
337 | CHECK_PRODUCT1 (a, b, t, v, vres); \ | |
338 | CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres) | |
339 | #define CHECK_SPRODUCT_WRAPV1(a, b, t, v, vres) \ | |
302 | 340 | { \ |
303 | 341 | t result; \ |
304 | 342 | ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v)); \ |
331 | 369 | CHECK_PRODUCT (INT_MAX, UINT_MAX, unsigned int, true, INT_MAX * UINT_MAX); |
332 | 370 | CHECK_PRODUCT (INT_MAX, ULONG_MAX, unsigned long int, true, |
333 | 371 | INT_MAX * ULONG_MAX); |
372 | #if !defined __HP_cc | |
334 | 373 | CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, long int, true, LONG_MIN); |
335 | 374 | CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN, long int, false, DONTCARE); |
375 | #endif | |
336 | 376 | CHECK_PRODUCT (INT_MIN, UINT_MAX, unsigned int, true, INT_MIN * UINT_MAX); |
337 | 377 | CHECK_PRODUCT (INT_MIN, ULONG_MAX, unsigned long int, true, |
338 | 378 | INT_MIN * ULONG_MAX); |
379 | CHECK_SPRODUCT_WRAPV (-1, INT_MAX + 1u, int, false, DONTCARE); | |
380 | CHECK_SPRODUCT_WRAPV (-1, 1u, int, false, DONTCARE); | |
381 | CHECK_SPRODUCT (0, ULONG_MAX, int, false, DONTCARE); | |
382 | CHECK_SPRODUCT (0u, LONG_MIN, int, false, DONTCARE); | |
339 | 383 | { |
340 | 384 | long int result; |
341 | 385 | ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result) |
357 | 401 | || result == LONG_MIN * (long long int) LONG_MIN); |
358 | 402 | } |
359 | 403 | # endif |
404 | ||
405 | /* Check for GCC bug 91450. */ | |
406 | { | |
407 | unsigned long long result; | |
408 | ASSERT (INT_MULTIPLY_WRAPV (int_minus_2, int_1, &result) && result == -2); | |
409 | } | |
360 | 410 | |
361 | 411 | #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v)) |
362 | 412 |
0 | 0 | /* Test of <inttypes.h> substitute. |
1 | Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of <limits.h> substitute. |
1 | Copyright 2016-2018 Free Software Foundation, Inc. | |
1 | Copyright 2016-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
25 | 25 | # pragma GCC diagnostic ignored "-Woverlength-strings" |
26 | 26 | #endif |
27 | 27 | |
28 | /* Macros specified by ISO/IEC TS 18661-1:2014. */ | |
29 | ||
30 | 28 | #define verify_width(width, min, max) \ |
31 | 29 | verify ((max) >> ((width) - 1 - ((min) < 0)) == 1) |
30 | ||
31 | /* Macros borrowed from intprops.h. */ | |
32 | #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) | |
33 | #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) | |
34 | #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) | |
35 | #define TYPE_MAXIMUM(t) \ | |
36 | ((t) (! TYPE_SIGNED (t) \ | |
37 | ? (t) -1 \ | |
38 | : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) | |
39 | ||
40 | /* Type width macros. */ | |
41 | ||
42 | int type_bits[] = | |
43 | { | |
44 | CHAR_BIT, | |
45 | WORD_BIT, | |
46 | LONG_BIT | |
47 | }; | |
48 | verify_width (CHAR_BIT, CHAR_MIN, CHAR_MAX); | |
49 | verify_width (WORD_BIT, INT_MIN, INT_MAX); | |
50 | verify_width (LONG_BIT, LONG_MIN, LONG_MAX); | |
51 | ||
52 | /* Numerical limit macros. */ | |
53 | ||
54 | char limits1[] = { CHAR_MIN, CHAR_MAX }; | |
55 | verify (TYPE_MINIMUM (char) == CHAR_MIN); | |
56 | verify (TYPE_MAXIMUM (char) == CHAR_MAX); | |
57 | ||
58 | signed char limits2[] = { SCHAR_MIN, SCHAR_MAX }; | |
59 | verify (TYPE_MINIMUM (signed char) == SCHAR_MIN); | |
60 | verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX); | |
61 | ||
62 | unsigned char limits3[] = { UCHAR_MAX }; | |
63 | verify (TYPE_MINIMUM (unsigned char) == 0); | |
64 | verify (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX); | |
65 | ||
66 | short limits4[] = { SHRT_MIN, SHRT_MAX }; | |
67 | verify (TYPE_MINIMUM (short int) == SHRT_MIN); | |
68 | verify (TYPE_MAXIMUM (short int) == SHRT_MAX); | |
69 | ||
70 | unsigned short limits5[] = { USHRT_MAX }; | |
71 | verify (TYPE_MINIMUM (unsigned short int) == 0); | |
72 | verify (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX); | |
73 | ||
74 | int limits6[] = { INT_MIN, INT_MAX }; | |
75 | verify (TYPE_MINIMUM (int) == INT_MIN); | |
76 | verify (TYPE_MAXIMUM (int) == INT_MAX); | |
77 | ||
78 | unsigned int limits7[] = { UINT_MAX }; | |
79 | verify (TYPE_MINIMUM (unsigned int) == 0); | |
80 | verify (TYPE_MAXIMUM (unsigned int) == UINT_MAX); | |
81 | ||
82 | long limits8[] = { LONG_MIN, LONG_MAX }; | |
83 | verify (TYPE_MINIMUM (long int) == LONG_MIN); | |
84 | verify (TYPE_MAXIMUM (long int) == LONG_MAX); | |
85 | ||
86 | unsigned long limits9[] = { ULONG_MAX }; | |
87 | verify (TYPE_MINIMUM (unsigned long int) == 0); | |
88 | verify (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX); | |
89 | ||
90 | long long limits10[] = { LLONG_MIN, LLONG_MAX }; | |
91 | verify (TYPE_MINIMUM (long long int) == LLONG_MIN); | |
92 | verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | |
93 | ||
94 | unsigned long long limits11[] = { ULLONG_MAX }; | |
95 | verify (TYPE_MINIMUM (unsigned long long int) == 0); | |
96 | verify (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX); | |
97 | ||
98 | /* Macros specified by ISO/IEC TS 18661-1:2014. */ | |
32 | 99 | |
33 | 100 | verify_width (CHAR_WIDTH, CHAR_MIN, CHAR_MAX); |
34 | 101 | verify_width (SCHAR_WIDTH, SCHAR_MIN, SCHAR_MAX); |
0 | 0 | /* |
1 | * Copyright (C) 2005, 2010-2018 Free Software Foundation, Inc. | |
1 | * Copyright (C) 2005, 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | * Written by Simon Josefsson |
3 | 3 | * |
4 | 4 | * This program is free software; you can redistribute it and/or modify |
0 | 0 | /* Test of <stdalign.h>. |
1 | Copyright 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of <stdbool.h> substitute. |
1 | Copyright (C) 2002-2007, 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2002-2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of <stddef.h> substitute. |
1 | Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of <stdint.h> substitute. |
1 | Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
216 | 216 | /* 7.18.2.4. Limits of integer types capable of holding object pointers */ |
217 | 217 | |
218 | 218 | intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX }; |
219 | verify (sizeof (void *) <= sizeof (intptr_t)); | |
219 | 220 | verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN); |
220 | 221 | verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX); |
221 | 222 | verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0); |
222 | 223 | verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0); |
223 | 224 | |
224 | 225 | uintptr_t h[2] = { 17, UINTPTR_MAX }; |
226 | verify (sizeof (void *) <= sizeof (uintptr_t)); | |
225 | 227 | verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX); |
226 | 228 | verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0); |
227 | 229 |
0 | 0 | /* Test of <string.h> substitute. |
1 | Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of strverscmp() function. |
1 | Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software; you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of <sys/types.h> substitute. |
1 | Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test of <unistd.h> substitute. |
1 | Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | #!/bin/sh | |
1 | # Test suite for update-copyright. | |
2 | # Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
3 | # This file is part of the GNUlib Library. | |
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 3 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
17 | ||
18 | diffout=`diff -u /dev/null /dev/null 2>&1` | |
19 | if test x"$diffout" = x"" && test $? -eq 0; then | |
20 | compare() { diff -u "$@"; } | |
21 | else | |
22 | compare() { cmp "$@"; } | |
23 | fi | |
24 | ||
25 | # Ensure the update-copyright program gets found. | |
26 | PATH=$abs_aux_dir:$PATH | |
27 | export PATH | |
28 | ||
29 | TMP_BASE=update-copyright.test | |
30 | trap 'rm -f $TMP_BASE*' 0 1 2 3 15 | |
31 | ||
32 | ## --------------------------------- ## | |
33 | ## Skip if user does not have perl. ## | |
34 | ## --------------------------------- ## | |
35 | ||
36 | TMP=$TMP_BASE | |
37 | s=$TMP-script | |
38 | cat <<\EOF > $s | |
39 | #!/bin/sh | |
40 | #! -*-perl-*- | |
41 | # This is a prologue that allows to run a perl script as an executable | |
42 | # on systems that are compliant to a POSIX version before POSIX:2017. | |
43 | # On such systems, the usual invocation of an executable through execlp() | |
44 | # or execvp() fails with ENOEXEC if it is a script that does not start | |
45 | # with a #! line. The script interpreter mentioned in the #! line has | |
46 | # to be /bin/sh, because on GuixSD systems that is the only program that | |
47 | # has a fixed file name. The second line is essential for perl and is | |
48 | # also useful for editing this file in Emacs. The next two lines below | |
49 | # are valid code in both sh and perl. When executed by sh, they re-execute | |
50 | # the script through the perl program found in $PATH. The '-x' option | |
51 | # is essential as well; without it, perl would re-execute the script | |
52 | # through /bin/sh. When executed by perl, the next two lines are a no-op. | |
53 | eval 'exec perl -wSx -pi "$0" "$@"' | |
54 | if 0; | |
55 | ||
56 | s/a/b/ | |
57 | EOF | |
58 | chmod a+x $s | |
59 | echo a > $TMP-in | |
60 | ./$s $TMP-in 2>/dev/null && test b = "`cat $TMP-in 2>/dev/null`" || | |
61 | { | |
62 | printf '%s\n' "$0: skipping this test;" \ | |
63 | 'your system has insufficient support for Perl' 1>&2 | |
64 | exit 77 | |
65 | } | |
66 | ||
67 | # Skip this test if Perl is too old. FIXME: 5.8.0 is just a guess. | |
68 | # We have a report that 5.6.1 is inadequate and that 5.8.0 works. | |
69 | perl -e 'require 5.8.0' || { | |
70 | echo '$0: skipping this test; Perl version is too old' 1>&2 | |
71 | exit 77 | |
72 | } | |
73 | ||
74 | # Do not let a different envvar setting perturb results. | |
75 | UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72 | |
76 | export UPDATE_COPYRIGHT_MAX_LINE_LENGTH | |
77 | ||
78 | ## ----------------------------- ## | |
79 | ## Examples from documentation. ## | |
80 | ## ----------------------------- ## | |
81 | ||
82 | TMP=$TMP_BASE-ex | |
83 | cat > $TMP.1 <<EOF | |
84 | Copyright @copyright{} 1990-2005, 2007-2009 Free Software | |
85 | Foundation, Inc. | |
86 | EOF | |
87 | cat > $TMP.2 <<EOF | |
88 | # Copyright (C) 1990-2005, 2007-2009 Free Software | |
89 | # Foundation, Inc. | |
90 | EOF | |
91 | cat > $TMP.3 <<EOF | |
92 | /* | |
93 | * Copyright © 90,2005,2007-2009 | |
94 | * Free Software Foundation, Inc. | |
95 | */ | |
96 | EOF | |
97 | cat > $TMP.4 <<EOF | |
98 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
99 | # Foundation, Inc. | |
100 | EOF | |
101 | cat > $TMP.5 <<EOF | |
102 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
103 | EOF | |
104 | cat > $TMP.6 <<EOF | |
105 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
106 | # Foundation, Inc. | |
107 | ||
108 | Copyright (C) 1990-2005, 2007-2009 Free Software Foundation, | |
109 | Inc. | |
110 | EOF | |
111 | cat > $TMP.7 <<EOF | |
112 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
113 | ||
114 | # Copyright (C) 1990-2005, 2007-2009 Free Software | |
115 | # Foundation, Inc. | |
116 | EOF | |
117 | ||
118 | UPDATE_COPYRIGHT_YEAR=2009 \ | |
119 | update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr | |
120 | compare /dev/null $TMP-stdout || exit 1 | |
121 | compare - $TMP-stderr <<EOF || exit 1 | |
122 | $TMP.4: warning: copyright statement not found | |
123 | $TMP.5: warning: copyright statement not found | |
124 | EOF | |
125 | compare - $TMP.1 <<EOF || exit 1 | |
126 | Copyright @copyright{} 1990-2005, 2007-2009 Free Software | |
127 | Foundation, Inc. | |
128 | EOF | |
129 | compare - $TMP.2 <<EOF || exit 1 | |
130 | # Copyright (C) 1990-2005, 2007-2009 Free Software | |
131 | # Foundation, Inc. | |
132 | EOF | |
133 | compare - $TMP.3 <<EOF || exit 1 | |
134 | /* | |
135 | * Copyright © 90,2005,2007-2009 | |
136 | * Free Software Foundation, Inc. | |
137 | */ | |
138 | EOF | |
139 | compare - $TMP.4 <<EOF || exit 1 | |
140 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
141 | # Foundation, Inc. | |
142 | EOF | |
143 | compare - $TMP.5 <<EOF || exit 1 | |
144 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
145 | EOF | |
146 | compare - $TMP.6 <<EOF || exit 1 | |
147 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
148 | # Foundation, Inc. | |
149 | ||
150 | Copyright (C) 1990-2005, 2007-2009 Free Software Foundation, | |
151 | Inc. | |
152 | EOF | |
153 | compare - $TMP.7 <<EOF || exit 1 | |
154 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
155 | ||
156 | # Copyright (C) 1990-2005, 2007-2009 Free Software | |
157 | # Foundation, Inc. | |
158 | EOF | |
159 | ||
160 | UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ | |
161 | update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr | |
162 | compare /dev/null $TMP-stdout || exit 1 | |
163 | compare - $TMP-stderr <<EOF || exit 1 | |
164 | $TMP.4: warning: copyright statement not found | |
165 | $TMP.5: warning: copyright statement not found | |
166 | EOF | |
167 | compare - $TMP.1 <<EOF || exit 1 | |
168 | Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation, | |
169 | Inc. | |
170 | EOF | |
171 | compare - $TMP.2 <<EOF || exit 1 | |
172 | # Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc. | |
173 | EOF | |
174 | compare - $TMP.3 <<EOF || exit 1 | |
175 | /* | |
176 | * Copyright © 1990, 2005, 2007-2010 Free Software Foundation, Inc. | |
177 | */ | |
178 | EOF | |
179 | compare - $TMP.4 <<EOF || exit 1 | |
180 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
181 | # Foundation, Inc. | |
182 | EOF | |
183 | compare - $TMP.5 <<EOF || exit 1 | |
184 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
185 | EOF | |
186 | compare - $TMP.6 <<EOF || exit 1 | |
187 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
188 | # Foundation, Inc. | |
189 | ||
190 | Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc. | |
191 | EOF | |
192 | compare - $TMP.7 <<EOF || exit 1 | |
193 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
194 | ||
195 | # Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc. | |
196 | EOF | |
197 | ||
198 | UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_FORCE=1 \ | |
199 | update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr | |
200 | compare /dev/null $TMP-stdout || exit 1 | |
201 | compare - $TMP-stderr <<EOF || exit 1 | |
202 | $TMP.4: warning: copyright statement not found | |
203 | $TMP.5: warning: copyright statement not found | |
204 | EOF | |
205 | compare - $TMP.1 <<EOF || exit 1 | |
206 | Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, | |
207 | 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 | |
208 | Free Software Foundation, Inc. | |
209 | EOF | |
210 | compare - $TMP.2 <<EOF || exit 1 | |
211 | # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
212 | # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free | |
213 | # Software Foundation, Inc. | |
214 | EOF | |
215 | compare - $TMP.3 <<EOF || exit 1 | |
216 | /* | |
217 | * Copyright © 1990, 2005, 2007, 2008, 2009, 2010 Free Software | |
218 | * Foundation, Inc. | |
219 | */ | |
220 | EOF | |
221 | compare - $TMP.4 <<EOF || exit 1 | |
222 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
223 | # Foundation, Inc. | |
224 | EOF | |
225 | compare - $TMP.5 <<EOF || exit 1 | |
226 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
227 | EOF | |
228 | compare - $TMP.6 <<EOF || exit 1 | |
229 | ## Copyright (C) 1990-2005, 2007-2009 Free Software | |
230 | # Foundation, Inc. | |
231 | ||
232 | Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
233 | 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free | |
234 | Software Foundation, Inc. | |
235 | EOF | |
236 | compare - $TMP.7 <<EOF || exit 1 | |
237 | Copyright (C) 1990-2005, 2007-2009 Acme, Inc. | |
238 | ||
239 | # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
240 | # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free | |
241 | # Software Foundation, Inc. | |
242 | EOF | |
243 | ||
244 | rm $TMP* | |
245 | ||
246 | ## -------------- ## | |
247 | ## Current year. ## | |
248 | ## -------------- ## | |
249 | ||
250 | TMP=$TMP_BASE-current-year | |
251 | YEAR=`date +%Y` | |
252 | cat > $TMP <<EOF | |
253 | '\" Copyright (C) 2006 | |
254 | '\" Free Software Foundation, | |
255 | '\" Inc. | |
256 | EOF | |
257 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
258 | compare /dev/null $TMP-stdout || exit 1 | |
259 | compare /dev/null $TMP-stderr || exit 1 | |
260 | compare - $TMP <<EOF || exit 1 | |
261 | '\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc. | |
262 | EOF | |
263 | UPDATE_COPYRIGHT_USE_INTERVALS=1 \ | |
264 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
265 | compare /dev/null $TMP-stdout || exit 1 | |
266 | compare /dev/null $TMP-stderr || exit 1 | |
267 | compare - $TMP <<EOF || exit 1 | |
268 | '\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc. | |
269 | EOF | |
270 | rm $TMP* | |
271 | ||
272 | ## ------------------ ## | |
273 | ## Surrounding text. ## | |
274 | ## ------------------ ## | |
275 | ||
276 | TMP=$TMP_BASE-surrounding-text | |
277 | cat > $TMP <<EOF | |
278 | Undisturbed text. | |
279 | dnl Undisturbed text. | |
280 | dnl Copyright (C) 89 | |
281 | dnl Free Software Foundation, Inc. | |
282 | dnl Undisturbed text. | |
283 | EOF | |
284 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
285 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
286 | compare /dev/null $TMP-stdout || exit 1 | |
287 | compare /dev/null $TMP-stderr || exit 1 | |
288 | compare - $TMP <<EOF || exit 1 | |
289 | Undisturbed text. | |
290 | dnl Undisturbed text. | |
291 | dnl Copyright (C) 1989, 2010 Free Software Foundation, Inc. | |
292 | dnl Undisturbed text. | |
293 | EOF | |
294 | rm $TMP* | |
295 | ||
296 | ## --------------- ## | |
297 | ## Widest prefix. ## | |
298 | ## --------------- ## | |
299 | ||
300 | TMP=$TMP_BASE-widest-prefix | |
301 | cat > $TMP <<EOF | |
302 | #### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, | |
303 | #### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | |
304 | #### 2008 Free Software Foundation, Inc. | |
305 | EOF | |
306 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
307 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
308 | compare /dev/null $TMP-stdout || exit 1 | |
309 | compare /dev/null $TMP-stderr || exit 1 | |
310 | compare - $TMP <<EOF || exit 1 | |
311 | #### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, | |
312 | #### 1985, 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, | |
313 | #### 2006, 2007, 2008, 2010 Free Software Foundation, Inc. | |
314 | EOF | |
315 | UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ | |
316 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
317 | compare /dev/null $TMP-stdout || exit 1 | |
318 | compare /dev/null $TMP-stderr || exit 1 | |
319 | compare - $TMP <<EOF || exit 1 | |
320 | #### Copyright (C) 1976-1988, 1999-2008, 2010-2011 Free Software | |
321 | #### Foundation, Inc. | |
322 | EOF | |
323 | rm $TMP* | |
324 | ||
325 | ## ------------------- ## | |
326 | ## Prefix too large. ## | |
327 | ## ------------------- ## | |
328 | ||
329 | TMP=$TMP_BASE-prefix-too-large | |
330 | cat > $TMP <<EOF | |
331 | #### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, | |
332 | #### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | |
333 | #### 2008 Free Software Foundation, Inc. | |
334 | EOF | |
335 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
336 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
337 | compare /dev/null $TMP-stdout || exit 1 | |
338 | compare - $TMP-stderr <<EOF || exit 1 | |
339 | $TMP: warning: copyright statement not found | |
340 | EOF | |
341 | compare - $TMP <<EOF || exit 1 | |
342 | #### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, | |
343 | #### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | |
344 | #### 2008 Free Software Foundation, Inc. | |
345 | EOF | |
346 | rm $TMP* | |
347 | ||
348 | ## ------------- ## | |
349 | ## Blank lines. ## | |
350 | ## ------------- ## | |
351 | ||
352 | TMP=$TMP_BASE-blank-lines | |
353 | cat > $TMP <<EOF | |
354 | #Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, | |
355 | # | |
356 | #1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | |
357 | #2008 Free Software Foundation, Inc. | |
358 | ||
359 | Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, | |
360 | ||
361 | 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | |
362 | 2008 Free Software Foundation, Inc. | |
363 | EOF | |
364 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
365 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
366 | compare /dev/null $TMP-stdout || exit 1 | |
367 | compare - $TMP-stderr <<EOF || exit 1 | |
368 | $TMP: warning: copyright statement not found | |
369 | EOF | |
370 | compare - $TMP <<EOF || exit 1 | |
371 | #Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, | |
372 | # | |
373 | #1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | |
374 | #2008 Free Software Foundation, Inc. | |
375 | ||
376 | Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, | |
377 | ||
378 | 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | |
379 | 2008 Free Software Foundation, Inc. | |
380 | EOF | |
381 | rm $TMP* | |
382 | ||
383 | ## -------------- ## | |
384 | ## Leading tabs. ## | |
385 | ## -------------- ## | |
386 | ||
387 | TMP=$TMP_BASE-leading-tabs | |
388 | cat > $TMP <<EOF | |
389 | Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98, | |
390 | 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free | |
391 | Software Foundation, Inc. | |
392 | EOF | |
393 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
394 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
395 | compare /dev/null $TMP-stdout || exit 1 | |
396 | compare /dev/null $TMP-stderr || exit 1 | |
397 | compare - $TMP <<EOF || exit 1 | |
398 | Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, | |
399 | 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | |
400 | 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | |
401 | EOF | |
402 | UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ | |
403 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
404 | compare /dev/null $TMP-stdout || exit 1 | |
405 | compare /dev/null $TMP-stderr || exit 1 | |
406 | compare - $TMP <<EOF || exit 1 | |
407 | Copyright (C) 1987-1988, 1991-2011 Free Software Foundation, | |
408 | Inc. | |
409 | EOF | |
410 | rm $TMP* | |
411 | ||
412 | ## -------------------- ## | |
413 | ## Unusual whitespace. ## | |
414 | ## -------------------- ## | |
415 | ||
416 | TMP=$TMP_BASE-unusual-ws | |
417 | cat > $TMP <<EOF | |
418 | # Copyright (C) 87-88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, | |
419 | # 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | |
420 | # 2009 Free Software Foundation, Inc. | |
421 | EOF | |
422 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
423 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
424 | compare /dev/null $TMP-stdout || exit 1 | |
425 | compare /dev/null $TMP-stderr || exit 1 | |
426 | compare - $TMP <<EOF || exit 1 | |
427 | # Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, | |
428 | # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, | |
429 | # 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software | |
430 | # Foundation, Inc. | |
431 | EOF | |
432 | UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \ | |
433 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
434 | compare /dev/null $TMP-stdout || exit 1 | |
435 | compare /dev/null $TMP-stderr || exit 1 | |
436 | compare - $TMP <<EOF || exit 1 | |
437 | # Copyright (C) 1987-1988, 1991-2011 Free Software | |
438 | # Foundation, Inc. | |
439 | EOF | |
440 | UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=2 \ | |
441 | UPDATE_COPYRIGHT_FORCE=1 update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
442 | compare /dev/null $TMP-stdout || exit 1 | |
443 | compare /dev/null $TMP-stderr || exit 1 | |
444 | compare - $TMP <<EOF || exit 1 | |
445 | # Copyright (C) 1987-2011 Free Software Foundation, Inc. | |
446 | EOF | |
447 | rm $TMP* | |
448 | ||
449 | ## --------- ## | |
450 | ## DOS EOL. ## | |
451 | ## --------- ## | |
452 | ||
453 | TMP=$TMP_BASE-dos-eol | |
454 | tr @ '\015' > $TMP <<\EOF | |
455 | Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@ | |
456 | Rem 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ | |
457 | Rem 2009 Free Software Foundation, Inc.@ | |
458 | EOF | |
459 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
460 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
461 | compare /dev/null $TMP-stdout || exit 1 | |
462 | compare /dev/null $TMP-stderr || exit 1 | |
463 | tr @ '\015' > $TMP-exp <<\EOF | |
464 | Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@ | |
465 | Rem 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ | |
466 | Rem 2009, 2010 Free Software Foundation, Inc.@ | |
467 | EOF | |
468 | compare $TMP-exp $TMP || exit 1 | |
469 | rm $TMP* | |
470 | ||
471 | ## --------------- ## | |
472 | ## Omitted "(C)". ## | |
473 | ## --------------- ## | |
474 | ||
475 | TMP=$TMP_BASE-omitted-circle-c | |
476 | cat > $TMP <<EOF | |
477 | Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, | |
478 | 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | |
479 | 2009 Free Software Foundation, Inc. | |
480 | EOF | |
481 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
482 | update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr | |
483 | compare /dev/null $TMP-stdout || exit 1 | |
484 | compare /dev/null $TMP-stderr || exit 1 | |
485 | compare - $TMP <<EOF || exit 1 | |
486 | Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
487 | 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | |
488 | Free Software Foundation, Inc. | |
489 | EOF | |
490 | rm $TMP* | |
491 | ||
492 | ## ------------------ ## | |
493 | ## C-style comments. ## | |
494 | ## ------------------ ## | |
495 | ||
496 | TMP=$TMP_BASE-c-style-comments | |
497 | cat > $TMP.star <<EOF | |
498 | /* Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, | |
499 | * 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | |
500 | * 2009 Free Software Foundation, Inc. */ | |
501 | EOF | |
502 | cat > $TMP.space <<EOF | |
503 | /*Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, | |
504 | 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | |
505 | 2009 Free Software Foundation, Inc. */ | |
506 | EOF | |
507 | cat > $TMP.single-line <<EOF | |
508 | /* Copyright 87, 1991, 1992 Free Software Foundation, Inc. */ | |
509 | EOF | |
510 | cat > $TMP.single-line-wrapped <<EOF | |
511 | /* Copyright 1988, 1991, 1992, 1993 Free Software Foundation, Inc. */ | |
512 | EOF | |
513 | cat > $TMP.extra-text-star <<EOF | |
514 | /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. End | |
515 | * More comments. */ | |
516 | EOF | |
517 | cat > $TMP.extra-text-space <<EOF | |
518 | /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. *** | |
519 | * End of comments. */ | |
520 | EOF | |
521 | cat > $TMP.two-digit-final-is-substr-of-first <<EOF | |
522 | /* Copyright 1991, 99 Free Software Foundation, Inc. */ | |
523 | EOF | |
524 | UPDATE_COPYRIGHT_YEAR=2010 \ | |
525 | update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr | |
526 | compare /dev/null $TMP-stdout || exit 1 | |
527 | compare /dev/null $TMP-stderr || exit 1 | |
528 | compare - $TMP.star <<EOF || exit 1 | |
529 | /* Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, | |
530 | * 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | |
531 | * 2009, 2010 Free Software Foundation, Inc. */ | |
532 | EOF | |
533 | compare - $TMP.space <<EOF || exit 1 | |
534 | /*Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, | |
535 | 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | |
536 | 2009, 2010 Free Software Foundation, Inc. */ | |
537 | EOF | |
538 | compare - $TMP.single-line <<EOF || exit 1 | |
539 | /* Copyright 1987, 1991, 1992, 2010 Free Software Foundation, Inc. */ | |
540 | EOF | |
541 | compare - $TMP.single-line-wrapped <<EOF || exit 1 | |
542 | /* Copyright 1988, 1991, 1992, 1993, 2010 Free Software Foundation, | |
543 | * Inc. */ | |
544 | EOF | |
545 | compare - $TMP.extra-text-star <<EOF || exit 1 | |
546 | /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation, | |
547 | * Inc. End | |
548 | * More comments. */ | |
549 | EOF | |
550 | compare - $TMP.extra-text-space <<EOF || exit 1 | |
551 | /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation, | |
552 | Inc. *** | |
553 | * End of comments. */ | |
554 | EOF | |
555 | compare - $TMP.two-digit-final-is-substr-of-first <<EOF || exit 1 | |
556 | /* Copyright 1991, 1999, 2010 Free Software Foundation, Inc. */ | |
557 | EOF | |
558 | rm $TMP* | |
559 | ||
560 | exit 0 |
0 | 0 | #!/bin/sh |
1 | 1 | # Unit tests for vc-list-files |
2 | # Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
3 | 3 | # This file is part of the GNUlib Library. |
4 | 4 | # |
5 | 5 | # This program is free software: you can redistribute it and/or modify |
16 | 16 | # along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
17 | 17 | |
18 | 18 | : ${srcdir=.} |
19 | . "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" . | |
19 | . "$srcdir/init.sh"; path_prepend_ . | |
20 | 20 | |
21 | 21 | tmpdir=vc-cvs |
22 | 22 | repo=`pwd`/$tmpdir/repo |
43 | 43 | cvs -Q -d "$repo" import -m imp m M M0 && |
44 | 44 | cvs -Q -d "$repo" co m && cd m && |
45 | 45 | printf '%s\n' b c d/a > expected && |
46 | vc-list-files | sort > actual && | |
46 | $BOURNE_SHELL "$abs_aux_dir/vc-list-files" | sort > actual && | |
47 | 47 | compare expected actual && |
48 | 48 | ok=1 |
49 | 49 | test $ok = 0 && fail=1 |
0 | 0 | #!/bin/sh |
1 | 1 | # Unit tests for vc-list-files |
2 | # Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
3 | 3 | # This file is part of the GNUlib Library. |
4 | 4 | # |
5 | 5 | # This program is free software: you can redistribute it and/or modify |
16 | 16 | # along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
17 | 17 | |
18 | 18 | : ${srcdir=.} |
19 | . "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" . | |
19 | . "$srcdir/init.sh"; path_prepend_ . | |
20 | 20 | |
21 | 21 | tmpdir=vc-git-$$ |
22 | 22 | GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE |
34 | 34 | git add . > /dev/null && |
35 | 35 | git commit -q -a -m log && |
36 | 36 | printf '%s\n' b c d/a > expected && |
37 | vc-list-files > actual && | |
37 | $BOURNE_SHELL "$abs_aux_dir/vc-list-files" > actual && | |
38 | 38 | compare expected actual && |
39 | 39 | fail=0 |
40 | 40 |
0 | 0 | /* Test the "verify" module. |
1 | 1 | |
2 | Copyright (C) 2017-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software: you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Test the "verify" module. |
1 | 1 | |
2 | Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software: you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU General Public License as published by |
38 | 38 | |
39 | 39 | enum |
40 | 40 | { |
41 | item = verify_true (1 == 1) * 0 + 17 /* should be ok */ | |
41 | item = verify_expr (1 == 1, 10 * 0 + 17) /* should be ok */ | |
42 | 42 | }; |
43 | 43 | |
44 | 44 | static int |
0 | 0 | /* Test of <wchar.h> substitute. |
1 | Copyright (C) 2007-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2007-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
0 | 0 | /* Compile-time assert-like macros. |
1 | 1 | |
2 | Copyright (C) 2005-2006, 2009-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software: you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU General Public License as published by |
20 | 20 | #define _GL_VERIFY_H |
21 | 21 | |
22 | 22 | |
23 | /* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11. | |
24 | This is supported by GCC 4.6.0 and later, in C mode, and its use | |
25 | here generates easier-to-read diagnostics when verify (R) fails. | |
26 | ||
27 | Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. | |
28 | This will likely be supported by future GCC versions, in C++ mode. | |
29 | ||
30 | Use this only with GCC. If we were willing to slow 'configure' | |
31 | down we could also use it with other compilers, but since this | |
32 | affects only the quality of diagnostics, why bother? */ | |
33 | #if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \ | |
34 | && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \ | |
35 | && !defined __cplusplus) | |
36 | # define _GL_HAVE__STATIC_ASSERT 1 | |
37 | #endif | |
38 | /* The condition (99 < __GNUC__) is temporary, until we know about the | |
39 | first G++ release that supports static_assert. */ | |
40 | #if (99 < __GNUC__) && defined __cplusplus | |
41 | # define _GL_HAVE_STATIC_ASSERT 1 | |
23 | /* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC) | |
24 | works as per C11. This is supported by GCC 4.6.0 and later, in C | |
25 | mode. | |
26 | ||
27 | Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as | |
28 | per C2X, and define _GL_HAVE_STATIC_ASSERT1 if static_assert (R) | |
29 | works as per C++17. This is supported by GCC 9.1 and later. | |
30 | ||
31 | Support compilers claiming conformance to the relevant standard, | |
32 | and also support GCC when not pedantic. If we were willing to slow | |
33 | 'configure' down we could also use it with other compilers, but | |
34 | since this affects only the quality of diagnostics, why bother? */ | |
35 | #ifndef __cplusplus | |
36 | # if (201112L <= __STDC_VERSION__ \ | |
37 | || (!defined __STRICT_ANSI__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__))) | |
38 | # define _GL_HAVE__STATIC_ASSERT 1 | |
39 | # endif | |
40 | # if (202000L <= __STDC_VERSION__ \ | |
41 | || (!defined __STRICT_ANSI__ && 9 <= __GNUC__)) | |
42 | # define _GL_HAVE__STATIC_ASSERT1 1 | |
43 | # endif | |
44 | #else | |
45 | # if 201703L <= __cplusplus || 9 <= __GNUC__ | |
46 | # define _GL_HAVE_STATIC_ASSERT1 1 | |
47 | # endif | |
42 | 48 | #endif |
43 | 49 | |
44 | 50 | /* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other |
45 | 51 | system headers, defines a conflicting _Static_assert that is no |
46 | 52 | better than ours; override it. */ |
47 | #ifndef _GL_HAVE_STATIC_ASSERT | |
53 | #ifndef _GL_HAVE__STATIC_ASSERT | |
48 | 54 | # include <stddef.h> |
49 | 55 | # undef _Static_assert |
50 | 56 | #endif |
142 | 148 | which do not support _Static_assert, also do not warn about the |
143 | 149 | last declaration mentioned above. |
144 | 150 | |
145 | * GCC warns if -Wnested-externs is enabled and verify() is used | |
151 | * GCC warns if -Wnested-externs is enabled and 'verify' is used | |
146 | 152 | within a function body; but inside a function, you can always |
147 | arrange to use verify_expr() instead. | |
153 | arrange to use verify_expr instead. | |
148 | 154 | |
149 | 155 | * In C++, any struct definition inside sizeof is invalid. |
150 | 156 | Use a template type to work around the problem. */ |
196 | 202 | #endif |
197 | 203 | |
198 | 204 | /* Verify requirement R at compile-time, as a declaration without a |
199 | trailing ';'. If R is false, fail at compile-time, preferably | |
200 | with a diagnostic that includes the string-literal DIAGNOSTIC. | |
205 | trailing ';'. If R is false, fail at compile-time. | |
206 | ||
207 | This macro requires three or more arguments but uses at most the first | |
208 | two, so that the _Static_assert macro optionally defined below supports | |
209 | both the C11 two-argument syntax and the C2X one-argument syntax. | |
201 | 210 | |
202 | 211 | Unfortunately, unlike C11, this implementation must appear as an |
203 | 212 | ordinary declaration, and cannot appear inside struct { ... }. */ |
204 | 213 | |
205 | #ifdef _GL_HAVE__STATIC_ASSERT | |
206 | # define _GL_VERIFY _Static_assert | |
207 | #else | |
208 | # define _GL_VERIFY(R, DIAGNOSTIC) \ | |
214 | #if defined _GL_HAVE__STATIC_ASSERT | |
215 | # define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC) | |
216 | #else | |
217 | # define _GL_VERIFY(R, DIAGNOSTIC, ...) \ | |
209 | 218 | extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ |
210 | 219 | [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] |
211 | 220 | #endif |
212 | 221 | |
213 | 222 | /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ |
214 | 223 | #ifdef _GL_STATIC_ASSERT_H |
215 | # if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert | |
216 | # define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) | |
217 | # endif | |
218 | # if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert | |
224 | # if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert | |
225 | # define _Static_assert(...) \ | |
226 | _GL_VERIFY (__VA_ARGS__, "static assertion failed", -) | |
227 | # endif | |
228 | # if !defined _GL_HAVE_STATIC_ASSERT1 && !defined static_assert | |
219 | 229 | # define static_assert _Static_assert /* C11 requires this #define. */ |
220 | 230 | # endif |
221 | 231 | #endif |
222 | 232 | |
223 | 233 | /* @assert.h omit start@ */ |
234 | ||
235 | #if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) | |
236 | # define _GL_HAS_BUILTIN_TRAP 1 | |
237 | #elif defined __has_builtin | |
238 | # define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap) | |
239 | #else | |
240 | # define _GL_HAS_BUILTIN_TRAP 0 | |
241 | #endif | |
242 | ||
243 | #if 4 < __GNUC__ + (5 <= __GNUC_MINOR__) | |
244 | # define _GL_HAS_BUILTIN_UNREACHABLE 1 | |
245 | #elif defined __has_builtin | |
246 | # define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable) | |
247 | #else | |
248 | # define _GL_HAS_BUILTIN_UNREACHABLE 0 | |
249 | #endif | |
224 | 250 | |
225 | 251 | /* Each of these macros verifies that its argument R is nonzero. To |
226 | 252 | be portable, R should be an integer constant expression. Unlike |
227 | 253 | assert (R), there is no run-time overhead. |
228 | 254 | |
229 | 255 | There are two macros, since no single macro can be used in all |
230 | contexts in C. verify_true (R) is for scalar contexts, including | |
256 | contexts in C. verify_expr (R, E) is for scalar contexts, including | |
231 | 257 | integer constant expression contexts. verify (R) is for declaration |
232 | 258 | contexts, e.g., the top level. */ |
233 | 259 | |
234 | /* Verify requirement R at compile-time, as an integer constant expression. | |
235 | Return 1. This is equivalent to verify_expr (R, 1). | |
236 | ||
237 | verify_true is obsolescent; please use verify_expr instead. */ | |
238 | ||
239 | #define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") | |
240 | ||
241 | 260 | /* Verify requirement R at compile-time. Return the value of the |
242 | 261 | expression E. */ |
243 | 262 | |
245 | 264 | (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E)) |
246 | 265 | |
247 | 266 | /* Verify requirement R at compile-time, as a declaration without a |
248 | trailing ';'. */ | |
249 | ||
250 | #ifdef __GNUC__ | |
251 | # define verify(R) _GL_VERIFY (R, "verify (" #R ")") | |
252 | #else | |
253 | /* PGI barfs if R is long. Play it safe. */ | |
254 | # define verify(R) _GL_VERIFY (R, "verify (...)") | |
255 | #endif | |
256 | ||
257 | #ifndef __has_builtin | |
258 | # define __has_builtin(x) 0 | |
259 | #endif | |
260 | ||
261 | /* Assume that R always holds. This lets the compiler optimize | |
262 | accordingly. R should not have side-effects; it may or may not be | |
263 | evaluated. Behavior is undefined if R is false. */ | |
264 | ||
265 | #if (__has_builtin (__builtin_unreachable) \ | |
266 | || 4 < __GNUC__ + (5 <= __GNUC_MINOR__)) | |
267 | trailing ';'. verify (R) acts like static_assert (R) except that | |
268 | it is portable to C11/C++14 and earlier, it can issue better | |
269 | diagnostics, and its name is shorter and may be more convenient. */ | |
270 | ||
271 | #ifdef __PGI | |
272 | /* PGI barfs if R is long. */ | |
273 | # define verify(R) _GL_VERIFY (R, "verify (...)", -) | |
274 | #else | |
275 | # define verify(R) _GL_VERIFY (R, "verify (" #R ")", -) | |
276 | #endif | |
277 | ||
278 | /* Assume that R always holds. Behavior is undefined if R is false, | |
279 | fails to evaluate, or has side effects. Although assuming R can | |
280 | help a compiler generate better code or diagnostics, performance | |
281 | can suffer if R uses hard-to-optimize features such as function | |
282 | calls not inlined by the compiler. */ | |
283 | ||
284 | #if _GL_HAS_BUILTIN_UNREACHABLE | |
267 | 285 | # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) |
268 | 286 | #elif 1200 <= _MSC_VER |
269 | 287 | # define assume(R) __assume (R) |
270 | #elif ((defined GCC_LINT || defined lint) \ | |
271 | && (__has_builtin (__builtin_trap) \ | |
272 | || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)))) | |
288 | #elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP | |
273 | 289 | /* Doing it this way helps various packages when configured with |
274 | 290 | --enable-gcc-warnings, which compiles with -Dlint. It's nicer |
275 | 291 | when 'assume' silences warnings even with older GCCs. */ |
0 | 0 | /* A C macro for emitting warnings if a function is used. |
1 | Copyright (C) 2010-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify it |
4 | 4 | under the terms of the GNU General Public License as published |
0 | 0 | /* A substitute for ISO C99 <wchar.h>, for platforms that have issues. |
1 | 1 | |
2 | Copyright (C) 2007-2018 Free Software Foundation, Inc. | |
2 | Copyright (C) 2007-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU General Public License as published by |
18 | 18 | |
19 | 19 | /* |
20 | 20 | * ISO C 99 <wchar.h> for platforms that have issues. |
21 | * <http://www.opengroup.org/susv3xbd/wchar.h.html> | |
21 | * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html> | |
22 | 22 | * |
23 | 23 | * For now, this just ensures proper prerequisite inclusion order and |
24 | 24 | * the declaration of wcwidth(). |
32 | 32 | #if (((defined __need_mbstate_t || defined __need_wint_t) \ |
33 | 33 | && !defined __MINGW32__) \ |
34 | 34 | || (defined __hpux \ |
35 | && ((defined _INTTYPES_INCLUDED && !defined strtoimax) \ | |
35 | && ((defined _INTTYPES_INCLUDED \ | |
36 | && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \ | |
36 | 37 | || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \ |
37 | 38 | || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \ |
38 | 39 | || defined _GL_ALREADY_INCLUDING_WCHAR_H) |
136 | 137 | |
137 | 138 | /* Override mbstate_t if it is too small. |
138 | 139 | On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for |
139 | implementing mbrtowc for encodings like UTF-8. */ | |
140 | #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ | |
140 | implementing mbrtowc for encodings like UTF-8. | |
141 | On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is | |
142 | large enough and overriding it would cause problems in C++ mode. */ | |
143 | #if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ | |
141 | 144 | # if !GNULIB_defined_mbstate_t |
145 | # if !(defined _AIX || defined _MSC_VER) | |
142 | 146 | typedef int rpl_mbstate_t; |
143 | # undef mbstate_t | |
144 | # define mbstate_t rpl_mbstate_t | |
147 | # undef mbstate_t | |
148 | # define mbstate_t rpl_mbstate_t | |
149 | # endif | |
145 | 150 | # define GNULIB_defined_mbstate_t 1 |
146 | 151 | # endif |
147 | 152 | #endif |
160 | 165 | # if !@HAVE_BTOWC@ |
161 | 166 | _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); |
162 | 167 | # endif |
163 | _GL_CXXALIAS_SYS (btowc, wint_t, (int c)); | |
164 | # endif | |
168 | /* Need to cast, because on mingw, the return type is 'unsigned short'. */ | |
169 | _GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c)); | |
170 | # endif | |
171 | # if __GLIBC__ >= 2 | |
165 | 172 | _GL_CXXALIASWARN (btowc); |
173 | # endif | |
166 | 174 | #elif defined GNULIB_POSIXCHECK |
167 | 175 | # undef btowc |
168 | 176 | # if HAVE_RAW_DECL_BTOWC |
188 | 196 | # endif |
189 | 197 | _GL_CXXALIAS_SYS (wctob, int, (wint_t wc)); |
190 | 198 | # endif |
199 | # if __GLIBC__ >= 2 | |
191 | 200 | _GL_CXXALIASWARN (wctob); |
201 | # endif | |
192 | 202 | #elif defined GNULIB_POSIXCHECK |
193 | 203 | # undef wctob |
194 | 204 | # if HAVE_RAW_DECL_WCTOB |
213 | 223 | # endif |
214 | 224 | _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps)); |
215 | 225 | # endif |
226 | # if __GLIBC__ >= 2 | |
216 | 227 | _GL_CXXALIASWARN (mbsinit); |
228 | # endif | |
217 | 229 | #elif defined GNULIB_POSIXCHECK |
218 | 230 | # undef mbsinit |
219 | 231 | # if HAVE_RAW_DECL_MBSINIT |
231 | 243 | # define mbrtowc rpl_mbrtowc |
232 | 244 | # endif |
233 | 245 | _GL_FUNCDECL_RPL (mbrtowc, size_t, |
234 | (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); | |
246 | (wchar_t *restrict pwc, const char *restrict s, size_t n, | |
247 | mbstate_t *restrict ps)); | |
235 | 248 | _GL_CXXALIAS_RPL (mbrtowc, size_t, |
236 | (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); | |
249 | (wchar_t *restrict pwc, const char *restrict s, size_t n, | |
250 | mbstate_t *restrict ps)); | |
237 | 251 | # else |
238 | 252 | # if !@HAVE_MBRTOWC@ |
239 | 253 | _GL_FUNCDECL_SYS (mbrtowc, size_t, |
240 | (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); | |
254 | (wchar_t *restrict pwc, const char *restrict s, size_t n, | |
255 | mbstate_t *restrict ps)); | |
241 | 256 | # endif |
242 | 257 | _GL_CXXALIAS_SYS (mbrtowc, size_t, |
243 | (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)); | |
244 | # endif | |
258 | (wchar_t *restrict pwc, const char *restrict s, size_t n, | |
259 | mbstate_t *restrict ps)); | |
260 | # endif | |
261 | # if __GLIBC__ >= 2 | |
245 | 262 | _GL_CXXALIASWARN (mbrtowc); |
263 | # endif | |
246 | 264 | #elif defined GNULIB_POSIXCHECK |
247 | 265 | # undef mbrtowc |
248 | 266 | # if HAVE_RAW_DECL_MBRTOWC |
259 | 277 | # undef mbrlen |
260 | 278 | # define mbrlen rpl_mbrlen |
261 | 279 | # endif |
262 | _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); | |
263 | _GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); | |
280 | _GL_FUNCDECL_RPL (mbrlen, size_t, | |
281 | (const char *restrict s, size_t n, mbstate_t *restrict ps)); | |
282 | _GL_CXXALIAS_RPL (mbrlen, size_t, | |
283 | (const char *restrict s, size_t n, mbstate_t *restrict ps)); | |
264 | 284 | # else |
265 | 285 | # if !@HAVE_MBRLEN@ |
266 | _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); | |
267 | # endif | |
268 | _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps)); | |
269 | # endif | |
286 | _GL_FUNCDECL_SYS (mbrlen, size_t, | |
287 | (const char *restrict s, size_t n, mbstate_t *restrict ps)); | |
288 | # endif | |
289 | _GL_CXXALIAS_SYS (mbrlen, size_t, | |
290 | (const char *restrict s, size_t n, mbstate_t *restrict ps)); | |
291 | # endif | |
292 | # if __GLIBC__ >= 2 | |
270 | 293 | _GL_CXXALIASWARN (mbrlen); |
294 | # endif | |
271 | 295 | #elif defined GNULIB_POSIXCHECK |
272 | 296 | # undef mbrlen |
273 | 297 | # if HAVE_RAW_DECL_MBRLEN |
285 | 309 | # define mbsrtowcs rpl_mbsrtowcs |
286 | 310 | # endif |
287 | 311 | _GL_FUNCDECL_RPL (mbsrtowcs, size_t, |
288 | (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) | |
312 | (wchar_t *restrict dest, | |
313 | const char **restrict srcp, size_t len, | |
314 | mbstate_t *restrict ps) | |
289 | 315 | _GL_ARG_NONNULL ((2))); |
290 | 316 | _GL_CXXALIAS_RPL (mbsrtowcs, size_t, |
291 | (wchar_t *dest, const char **srcp, size_t len, | |
292 | mbstate_t *ps)); | |
317 | (wchar_t *restrict dest, | |
318 | const char **restrict srcp, size_t len, | |
319 | mbstate_t *restrict ps)); | |
293 | 320 | # else |
294 | 321 | # if !@HAVE_MBSRTOWCS@ |
295 | 322 | _GL_FUNCDECL_SYS (mbsrtowcs, size_t, |
296 | (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) | |
323 | (wchar_t *restrict dest, | |
324 | const char **restrict srcp, size_t len, | |
325 | mbstate_t *restrict ps) | |
297 | 326 | _GL_ARG_NONNULL ((2))); |
298 | 327 | # endif |
299 | 328 | _GL_CXXALIAS_SYS (mbsrtowcs, size_t, |
300 | (wchar_t *dest, const char **srcp, size_t len, | |
301 | mbstate_t *ps)); | |
302 | # endif | |
329 | (wchar_t *restrict dest, | |
330 | const char **restrict srcp, size_t len, | |
331 | mbstate_t *restrict ps)); | |
332 | # endif | |
333 | # if __GLIBC__ >= 2 | |
303 | 334 | _GL_CXXALIASWARN (mbsrtowcs); |
335 | # endif | |
304 | 336 | #elif defined GNULIB_POSIXCHECK |
305 | 337 | # undef mbsrtowcs |
306 | 338 | # if HAVE_RAW_DECL_MBSRTOWCS |
318 | 350 | # define mbsnrtowcs rpl_mbsnrtowcs |
319 | 351 | # endif |
320 | 352 | _GL_FUNCDECL_RPL (mbsnrtowcs, size_t, |
321 | (wchar_t *dest, const char **srcp, size_t srclen, size_t len, | |
322 | mbstate_t *ps) | |
353 | (wchar_t *restrict dest, | |
354 | const char **restrict srcp, size_t srclen, size_t len, | |
355 | mbstate_t *restrict ps) | |
323 | 356 | _GL_ARG_NONNULL ((2))); |
324 | 357 | _GL_CXXALIAS_RPL (mbsnrtowcs, size_t, |
325 | (wchar_t *dest, const char **srcp, size_t srclen, size_t len, | |
326 | mbstate_t *ps)); | |
358 | (wchar_t *restrict dest, | |
359 | const char **restrict srcp, size_t srclen, size_t len, | |
360 | mbstate_t *restrict ps)); | |
327 | 361 | # else |
328 | 362 | # if !@HAVE_MBSNRTOWCS@ |
329 | 363 | _GL_FUNCDECL_SYS (mbsnrtowcs, size_t, |
330 | (wchar_t *dest, const char **srcp, size_t srclen, size_t len, | |
331 | mbstate_t *ps) | |
364 | (wchar_t *restrict dest, | |
365 | const char **restrict srcp, size_t srclen, size_t len, | |
366 | mbstate_t *restrict ps) | |
332 | 367 | _GL_ARG_NONNULL ((2))); |
333 | 368 | # endif |
334 | 369 | _GL_CXXALIAS_SYS (mbsnrtowcs, size_t, |
335 | (wchar_t *dest, const char **srcp, size_t srclen, size_t len, | |
336 | mbstate_t *ps)); | |
370 | (wchar_t *restrict dest, | |
371 | const char **restrict srcp, size_t srclen, size_t len, | |
372 | mbstate_t *restrict ps)); | |
337 | 373 | # endif |
338 | 374 | _GL_CXXALIASWARN (mbsnrtowcs); |
339 | 375 | #elif defined GNULIB_POSIXCHECK |
352 | 388 | # undef wcrtomb |
353 | 389 | # define wcrtomb rpl_wcrtomb |
354 | 390 | # endif |
355 | _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); | |
356 | _GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); | |
391 | _GL_FUNCDECL_RPL (wcrtomb, size_t, | |
392 | (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); | |
393 | _GL_CXXALIAS_RPL (wcrtomb, size_t, | |
394 | (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); | |
357 | 395 | # else |
358 | 396 | # if !@HAVE_WCRTOMB@ |
359 | _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); | |
360 | # endif | |
361 | _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps)); | |
362 | # endif | |
397 | _GL_FUNCDECL_SYS (wcrtomb, size_t, | |
398 | (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); | |
399 | # endif | |
400 | _GL_CXXALIAS_SYS (wcrtomb, size_t, | |
401 | (char *restrict s, wchar_t wc, mbstate_t *restrict ps)); | |
402 | # endif | |
403 | # if __GLIBC__ >= 2 | |
363 | 404 | _GL_CXXALIASWARN (wcrtomb); |
405 | # endif | |
364 | 406 | #elif defined GNULIB_POSIXCHECK |
365 | 407 | # undef wcrtomb |
366 | 408 | # if HAVE_RAW_DECL_WCRTOMB |
378 | 420 | # define wcsrtombs rpl_wcsrtombs |
379 | 421 | # endif |
380 | 422 | _GL_FUNCDECL_RPL (wcsrtombs, size_t, |
381 | (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps) | |
423 | (char *restrict dest, const wchar_t **restrict srcp, | |
424 | size_t len, | |
425 | mbstate_t *restrict ps) | |
382 | 426 | _GL_ARG_NONNULL ((2))); |
383 | 427 | _GL_CXXALIAS_RPL (wcsrtombs, size_t, |
384 | (char *dest, const wchar_t **srcp, size_t len, | |
385 | mbstate_t *ps)); | |
428 | (char *restrict dest, const wchar_t **restrict srcp, | |
429 | size_t len, | |
430 | mbstate_t *restrict ps)); | |
386 | 431 | # else |
387 | 432 | # if !@HAVE_WCSRTOMBS@ |
388 | 433 | _GL_FUNCDECL_SYS (wcsrtombs, size_t, |
389 | (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps) | |
434 | (char *restrict dest, const wchar_t **restrict srcp, | |
435 | size_t len, | |
436 | mbstate_t *restrict ps) | |
390 | 437 | _GL_ARG_NONNULL ((2))); |
391 | 438 | # endif |
392 | 439 | _GL_CXXALIAS_SYS (wcsrtombs, size_t, |
393 | (char *dest, const wchar_t **srcp, size_t len, | |
394 | mbstate_t *ps)); | |
395 | # endif | |
440 | (char *restrict dest, const wchar_t **restrict srcp, | |
441 | size_t len, | |
442 | mbstate_t *restrict ps)); | |
443 | # endif | |
444 | # if __GLIBC__ >= 2 | |
396 | 445 | _GL_CXXALIASWARN (wcsrtombs); |
446 | # endif | |
397 | 447 | #elif defined GNULIB_POSIXCHECK |
398 | 448 | # undef wcsrtombs |
399 | 449 | # if HAVE_RAW_DECL_WCSRTOMBS |
411 | 461 | # define wcsnrtombs rpl_wcsnrtombs |
412 | 462 | # endif |
413 | 463 | _GL_FUNCDECL_RPL (wcsnrtombs, size_t, |
414 | (char *dest, const wchar_t **srcp, size_t srclen, size_t len, | |
415 | mbstate_t *ps) | |
464 | (char *restrict dest, | |
465 | const wchar_t **restrict srcp, size_t srclen, | |
466 | size_t len, | |
467 | mbstate_t *restrict ps) | |
416 | 468 | _GL_ARG_NONNULL ((2))); |
417 | 469 | _GL_CXXALIAS_RPL (wcsnrtombs, size_t, |
418 | (char *dest, const wchar_t **srcp, size_t srclen, size_t len, | |
419 | mbstate_t *ps)); | |
420 | # else | |
421 | # if !@HAVE_WCSNRTOMBS@ | |
470 | (char *restrict dest, | |
471 | const wchar_t **restrict srcp, size_t srclen, | |
472 | size_t len, | |
473 | mbstate_t *restrict ps)); | |
474 | # else | |
475 | # if !@HAVE_WCSNRTOMBS@ || (defined __cplusplus && defined __sun) | |
422 | 476 | _GL_FUNCDECL_SYS (wcsnrtombs, size_t, |
423 | (char *dest, const wchar_t **srcp, size_t srclen, size_t len, | |
424 | mbstate_t *ps) | |
477 | (char *restrict dest, | |
478 | const wchar_t **restrict srcp, size_t srclen, | |
479 | size_t len, | |
480 | mbstate_t *restrict ps) | |
425 | 481 | _GL_ARG_NONNULL ((2))); |
426 | 482 | # endif |
427 | 483 | _GL_CXXALIAS_SYS (wcsnrtombs, size_t, |
428 | (char *dest, const wchar_t **srcp, size_t srclen, size_t len, | |
429 | mbstate_t *ps)); | |
430 | # endif | |
484 | (char *restrict dest, | |
485 | const wchar_t **restrict srcp, size_t srclen, | |
486 | size_t len, | |
487 | mbstate_t *restrict ps)); | |
488 | # endif | |
489 | # if __GLIBC__ >= 2 | |
431 | 490 | _GL_CXXALIASWARN (wcsnrtombs); |
491 | # endif | |
432 | 492 | #elif defined GNULIB_POSIXCHECK |
433 | 493 | # undef wcsnrtombs |
434 | 494 | # if HAVE_RAW_DECL_WCSNRTOMBS |
454 | 514 | # endif |
455 | 515 | _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t)); |
456 | 516 | # endif |
517 | # if __GLIBC__ >= 2 | |
457 | 518 | _GL_CXXALIASWARN (wcwidth); |
519 | # endif | |
458 | 520 | #elif defined GNULIB_POSIXCHECK |
459 | 521 | # undef wcwidth |
460 | 522 | # if HAVE_RAW_DECL_WCWIDTH |
483 | 545 | _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); |
484 | 546 | _GL_CXXALIASWARN1 (wmemchr, const wchar_t *, |
485 | 547 | (const wchar_t *s, wchar_t c, size_t n)); |
486 | # else | |
548 | # elif __GLIBC__ >= 2 | |
487 | 549 | _GL_CXXALIASWARN (wmemchr); |
488 | 550 | # endif |
489 | 551 | #elif defined GNULIB_POSIXCHECK |
504 | 566 | # endif |
505 | 567 | _GL_CXXALIAS_SYS (wmemcmp, int, |
506 | 568 | (const wchar_t *s1, const wchar_t *s2, size_t n)); |
569 | # if __GLIBC__ >= 2 | |
507 | 570 | _GL_CXXALIASWARN (wmemcmp); |
571 | # endif | |
508 | 572 | #elif defined GNULIB_POSIXCHECK |
509 | 573 | # undef wmemcmp |
510 | 574 | # if HAVE_RAW_DECL_WMEMCMP |
518 | 582 | #if @GNULIB_WMEMCPY@ |
519 | 583 | # if !@HAVE_WMEMCPY@ |
520 | 584 | _GL_FUNCDECL_SYS (wmemcpy, wchar_t *, |
521 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
585 | (wchar_t *restrict dest, | |
586 | const wchar_t *restrict src, size_t n)); | |
522 | 587 | # endif |
523 | 588 | _GL_CXXALIAS_SYS (wmemcpy, wchar_t *, |
524 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
589 | (wchar_t *restrict dest, | |
590 | const wchar_t *restrict src, size_t n)); | |
591 | # if __GLIBC__ >= 2 | |
525 | 592 | _GL_CXXALIASWARN (wmemcpy); |
593 | # endif | |
526 | 594 | #elif defined GNULIB_POSIXCHECK |
527 | 595 | # undef wmemcpy |
528 | 596 | # if HAVE_RAW_DECL_WMEMCPY |
541 | 609 | # endif |
542 | 610 | _GL_CXXALIAS_SYS (wmemmove, wchar_t *, |
543 | 611 | (wchar_t *dest, const wchar_t *src, size_t n)); |
612 | # if __GLIBC__ >= 2 | |
544 | 613 | _GL_CXXALIASWARN (wmemmove); |
614 | # endif | |
545 | 615 | #elif defined GNULIB_POSIXCHECK |
546 | 616 | # undef wmemmove |
547 | 617 | # if HAVE_RAW_DECL_WMEMMOVE |
557 | 627 | _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); |
558 | 628 | # endif |
559 | 629 | _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); |
630 | # if __GLIBC__ >= 2 | |
560 | 631 | _GL_CXXALIASWARN (wmemset); |
632 | # endif | |
561 | 633 | #elif defined GNULIB_POSIXCHECK |
562 | 634 | # undef wmemset |
563 | 635 | # if HAVE_RAW_DECL_WMEMSET |
573 | 645 | _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE); |
574 | 646 | # endif |
575 | 647 | _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s)); |
648 | # if __GLIBC__ >= 2 | |
576 | 649 | _GL_CXXALIASWARN (wcslen); |
650 | # endif | |
577 | 651 | #elif defined GNULIB_POSIXCHECK |
578 | 652 | # undef wcslen |
579 | 653 | # if HAVE_RAW_DECL_WCSLEN |
603 | 677 | /* Copy SRC to DEST. */ |
604 | 678 | #if @GNULIB_WCSCPY@ |
605 | 679 | # if !@HAVE_WCSCPY@ |
606 | _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); | |
607 | # endif | |
608 | _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); | |
680 | _GL_FUNCDECL_SYS (wcscpy, wchar_t *, | |
681 | (wchar_t *restrict dest, const wchar_t *restrict src)); | |
682 | # endif | |
683 | _GL_CXXALIAS_SYS (wcscpy, wchar_t *, | |
684 | (wchar_t *restrict dest, const wchar_t *restrict src)); | |
685 | # if __GLIBC__ >= 2 | |
609 | 686 | _GL_CXXALIASWARN (wcscpy); |
687 | # endif | |
610 | 688 | #elif defined GNULIB_POSIXCHECK |
611 | 689 | # undef wcscpy |
612 | 690 | # if HAVE_RAW_DECL_WCSCPY |
619 | 697 | /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ |
620 | 698 | #if @GNULIB_WCPCPY@ |
621 | 699 | # if !@HAVE_WCPCPY@ |
622 | _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); | |
623 | # endif | |
624 | _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); | |
700 | _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, | |
701 | (wchar_t *restrict dest, const wchar_t *restrict src)); | |
702 | # endif | |
703 | _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, | |
704 | (wchar_t *restrict dest, const wchar_t *restrict src)); | |
625 | 705 | _GL_CXXALIASWARN (wcpcpy); |
626 | 706 | #elif defined GNULIB_POSIXCHECK |
627 | 707 | # undef wcpcpy |
636 | 716 | #if @GNULIB_WCSNCPY@ |
637 | 717 | # if !@HAVE_WCSNCPY@ |
638 | 718 | _GL_FUNCDECL_SYS (wcsncpy, wchar_t *, |
639 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
719 | (wchar_t *restrict dest, | |
720 | const wchar_t *restrict src, size_t n)); | |
640 | 721 | # endif |
641 | 722 | _GL_CXXALIAS_SYS (wcsncpy, wchar_t *, |
642 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
723 | (wchar_t *restrict dest, | |
724 | const wchar_t *restrict src, size_t n)); | |
725 | # if __GLIBC__ >= 2 | |
643 | 726 | _GL_CXXALIASWARN (wcsncpy); |
727 | # endif | |
644 | 728 | #elif defined GNULIB_POSIXCHECK |
645 | 729 | # undef wcsncpy |
646 | 730 | # if HAVE_RAW_DECL_WCSNCPY |
655 | 739 | #if @GNULIB_WCPNCPY@ |
656 | 740 | # if !@HAVE_WCPNCPY@ |
657 | 741 | _GL_FUNCDECL_SYS (wcpncpy, wchar_t *, |
658 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
742 | (wchar_t *restrict dest, | |
743 | const wchar_t *restrict src, size_t n)); | |
659 | 744 | # endif |
660 | 745 | _GL_CXXALIAS_SYS (wcpncpy, wchar_t *, |
661 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
746 | (wchar_t *restrict dest, | |
747 | const wchar_t *restrict src, size_t n)); | |
662 | 748 | _GL_CXXALIASWARN (wcpncpy); |
663 | 749 | #elif defined GNULIB_POSIXCHECK |
664 | 750 | # undef wcpncpy |
672 | 758 | /* Append SRC onto DEST. */ |
673 | 759 | #if @GNULIB_WCSCAT@ |
674 | 760 | # if !@HAVE_WCSCAT@ |
675 | _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); | |
676 | # endif | |
677 | _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); | |
761 | _GL_FUNCDECL_SYS (wcscat, wchar_t *, | |
762 | (wchar_t *restrict dest, const wchar_t *restrict src)); | |
763 | # endif | |
764 | _GL_CXXALIAS_SYS (wcscat, wchar_t *, | |
765 | (wchar_t *restrict dest, const wchar_t *restrict src)); | |
766 | # if __GLIBC__ >= 2 | |
678 | 767 | _GL_CXXALIASWARN (wcscat); |
768 | # endif | |
679 | 769 | #elif defined GNULIB_POSIXCHECK |
680 | 770 | # undef wcscat |
681 | 771 | # if HAVE_RAW_DECL_WCSCAT |
689 | 779 | #if @GNULIB_WCSNCAT@ |
690 | 780 | # if !@HAVE_WCSNCAT@ |
691 | 781 | _GL_FUNCDECL_SYS (wcsncat, wchar_t *, |
692 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
782 | (wchar_t *restrict dest, const wchar_t *restrict src, | |
783 | size_t n)); | |
693 | 784 | # endif |
694 | 785 | _GL_CXXALIAS_SYS (wcsncat, wchar_t *, |
695 | (wchar_t *dest, const wchar_t *src, size_t n)); | |
786 | (wchar_t *restrict dest, const wchar_t *restrict src, | |
787 | size_t n)); | |
788 | # if __GLIBC__ >= 2 | |
696 | 789 | _GL_CXXALIASWARN (wcsncat); |
790 | # endif | |
697 | 791 | #elif defined GNULIB_POSIXCHECK |
698 | 792 | # undef wcsncat |
699 | 793 | # if HAVE_RAW_DECL_WCSNCAT |
710 | 804 | _GL_ATTRIBUTE_PURE); |
711 | 805 | # endif |
712 | 806 | _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); |
807 | # if __GLIBC__ >= 2 | |
713 | 808 | _GL_CXXALIASWARN (wcscmp); |
809 | # endif | |
714 | 810 | #elif defined GNULIB_POSIXCHECK |
715 | 811 | # undef wcscmp |
716 | 812 | # if HAVE_RAW_DECL_WCSCMP |
729 | 825 | # endif |
730 | 826 | _GL_CXXALIAS_SYS (wcsncmp, int, |
731 | 827 | (const wchar_t *s1, const wchar_t *s2, size_t n)); |
828 | # if __GLIBC__ >= 2 | |
732 | 829 | _GL_CXXALIASWARN (wcsncmp); |
830 | # endif | |
733 | 831 | #elif defined GNULIB_POSIXCHECK |
734 | 832 | # undef wcsncmp |
735 | 833 | # if HAVE_RAW_DECL_WCSNCMP |
782 | 880 | _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); |
783 | 881 | # endif |
784 | 882 | _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); |
883 | # if __GLIBC__ >= 2 | |
785 | 884 | _GL_CXXALIASWARN (wcscoll); |
885 | # endif | |
786 | 886 | #elif defined GNULIB_POSIXCHECK |
787 | 887 | # undef wcscoll |
788 | 888 | # if HAVE_RAW_DECL_WCSCOLL |
797 | 897 | original strings. */ |
798 | 898 | #if @GNULIB_WCSXFRM@ |
799 | 899 | # if !@HAVE_WCSXFRM@ |
800 | _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); | |
801 | # endif | |
802 | _GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); | |
900 | _GL_FUNCDECL_SYS (wcsxfrm, size_t, | |
901 | (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n)); | |
902 | # endif | |
903 | _GL_CXXALIAS_SYS (wcsxfrm, size_t, | |
904 | (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n)); | |
905 | # if __GLIBC__ >= 2 | |
803 | 906 | _GL_CXXALIASWARN (wcsxfrm); |
907 | # endif | |
804 | 908 | #elif defined GNULIB_POSIXCHECK |
805 | 909 | # undef wcsxfrm |
806 | 910 | # if HAVE_RAW_DECL_WCSXFRM |
844 | 948 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) |
845 | 949 | _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc)); |
846 | 950 | _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); |
847 | # else | |
951 | # elif __GLIBC__ >= 2 | |
848 | 952 | _GL_CXXALIASWARN (wcschr); |
849 | 953 | # endif |
850 | 954 | #elif defined GNULIB_POSIXCHECK |
874 | 978 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) |
875 | 979 | _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc)); |
876 | 980 | _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); |
877 | # else | |
981 | # elif __GLIBC__ >= 2 | |
878 | 982 | _GL_CXXALIASWARN (wcsrchr); |
879 | 983 | # endif |
880 | 984 | #elif defined GNULIB_POSIXCHECK |
894 | 998 | _GL_ATTRIBUTE_PURE); |
895 | 999 | # endif |
896 | 1000 | _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)); |
1001 | # if __GLIBC__ >= 2 | |
897 | 1002 | _GL_CXXALIASWARN (wcscspn); |
1003 | # endif | |
898 | 1004 | #elif defined GNULIB_POSIXCHECK |
899 | 1005 | # undef wcscspn |
900 | 1006 | # if HAVE_RAW_DECL_WCSCSPN |
912 | 1018 | _GL_ATTRIBUTE_PURE); |
913 | 1019 | # endif |
914 | 1020 | _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)); |
1021 | # if __GLIBC__ >= 2 | |
915 | 1022 | _GL_CXXALIASWARN (wcsspn); |
1023 | # endif | |
916 | 1024 | #elif defined GNULIB_POSIXCHECK |
917 | 1025 | # undef wcsspn |
918 | 1026 | # if HAVE_RAW_DECL_WCSSPN |
943 | 1051 | (wchar_t *wcs, const wchar_t *accept)); |
944 | 1052 | _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *, |
945 | 1053 | (const wchar_t *wcs, const wchar_t *accept)); |
946 | # else | |
1054 | # elif __GLIBC__ >= 2 | |
947 | 1055 | _GL_CXXALIASWARN (wcspbrk); |
948 | 1056 | # endif |
949 | 1057 | #elif defined GNULIB_POSIXCHECK |
959 | 1067 | #if @GNULIB_WCSSTR@ |
960 | 1068 | # if !@HAVE_WCSSTR@ |
961 | 1069 | _GL_FUNCDECL_SYS (wcsstr, wchar_t *, |
962 | (const wchar_t *haystack, const wchar_t *needle) | |
1070 | (const wchar_t *restrict haystack, | |
1071 | const wchar_t *restrict needle) | |
963 | 1072 | _GL_ATTRIBUTE_PURE); |
964 | 1073 | # endif |
965 | 1074 | /* On some systems, this function is defined as an overloaded function: |
968 | 1077 | wchar_t * std::wcsstr (wchar_t *, const wchar_t *); |
969 | 1078 | } */ |
970 | 1079 | _GL_CXXALIAS_SYS_CAST2 (wcsstr, |
971 | wchar_t *, (const wchar_t *, const wchar_t *), | |
972 | const wchar_t *, (const wchar_t *, const wchar_t *)); | |
1080 | wchar_t *, | |
1081 | (const wchar_t *restrict, const wchar_t *restrict), | |
1082 | const wchar_t *, | |
1083 | (const wchar_t *restrict, const wchar_t *restrict)); | |
973 | 1084 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ |
974 | 1085 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) |
975 | 1086 | _GL_CXXALIASWARN1 (wcsstr, wchar_t *, |
976 | (wchar_t *haystack, const wchar_t *needle)); | |
1087 | (wchar_t *restrict haystack, | |
1088 | const wchar_t *restrict needle)); | |
977 | 1089 | _GL_CXXALIASWARN1 (wcsstr, const wchar_t *, |
978 | (const wchar_t *haystack, const wchar_t *needle)); | |
979 | # else | |
1090 | (const wchar_t *restrict haystack, | |
1091 | const wchar_t *restrict needle)); | |
1092 | # elif __GLIBC__ >= 2 | |
980 | 1093 | _GL_CXXALIASWARN (wcsstr); |
981 | 1094 | # endif |
982 | 1095 | #elif defined GNULIB_POSIXCHECK |
990 | 1103 | |
991 | 1104 | /* Divide WCS into tokens separated by characters in DELIM. */ |
992 | 1105 | #if @GNULIB_WCSTOK@ |
993 | # if !@HAVE_WCSTOK@ | |
1106 | # if @REPLACE_WCSTOK@ | |
1107 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
1108 | # undef wcstok | |
1109 | # define wcstok rpl_wcstok | |
1110 | # endif | |
1111 | _GL_FUNCDECL_RPL (wcstok, wchar_t *, | |
1112 | (wchar_t *restrict wcs, const wchar_t *restrict delim, | |
1113 | wchar_t **restrict ptr)); | |
1114 | _GL_CXXALIAS_RPL (wcstok, wchar_t *, | |
1115 | (wchar_t *restrict wcs, const wchar_t *restrict delim, | |
1116 | wchar_t **restrict ptr)); | |
1117 | # else | |
1118 | # if !@HAVE_WCSTOK@ | |
994 | 1119 | _GL_FUNCDECL_SYS (wcstok, wchar_t *, |
995 | (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); | |
996 | # endif | |
1120 | (wchar_t *restrict wcs, const wchar_t *restrict delim, | |
1121 | wchar_t **restrict ptr)); | |
1122 | # endif | |
997 | 1123 | _GL_CXXALIAS_SYS (wcstok, wchar_t *, |
998 | (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); | |
1124 | (wchar_t *restrict wcs, const wchar_t *restrict delim, | |
1125 | wchar_t **restrict ptr)); | |
1126 | # endif | |
1127 | # if __GLIBC__ >= 2 | |
999 | 1128 | _GL_CXXALIASWARN (wcstok); |
1129 | # endif | |
1000 | 1130 | #elif defined GNULIB_POSIXCHECK |
1001 | 1131 | # undef wcstok |
1002 | 1132 | # if HAVE_RAW_DECL_WCSTOK |
1024 | 1154 | # endif |
1025 | 1155 | _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n)); |
1026 | 1156 | # endif |
1157 | # if __GLIBC__ >= 2 | |
1027 | 1158 | _GL_CXXALIASWARN (wcswidth); |
1159 | # endif | |
1028 | 1160 | #elif defined GNULIB_POSIXCHECK |
1029 | 1161 | # undef wcswidth |
1030 | 1162 | # if HAVE_RAW_DECL_WCSWIDTH |
1035 | 1167 | |
1036 | 1168 | |
1037 | 1169 | /* Convert *TP to a date and time wide string. See |
1038 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>. */ | |
1170 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>. */ | |
1039 | 1171 | #if @GNULIB_WCSFTIME@ |
1040 | 1172 | # if @REPLACE_WCSFTIME@ |
1041 | 1173 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1042 | 1174 | # undef wcsftime |
1043 | 1175 | # define wcsftime rpl_wcsftime |
1044 | 1176 | # endif |
1045 | _GL_FUNCDECL_RPL (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, | |
1046 | const wchar_t *__fmt, const struct tm *__tp) | |
1047 | _GL_ARG_NONNULL ((1, 3, 4))); | |
1048 | _GL_CXXALIAS_RPL (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, | |
1049 | const wchar_t *__fmt, const struct tm *__tp)); | |
1177 | _GL_FUNCDECL_RPL (wcsftime, size_t, | |
1178 | (wchar_t *restrict __buf, size_t __bufsize, | |
1179 | const wchar_t *restrict __fmt, | |
1180 | const struct tm *restrict __tp) | |
1181 | _GL_ARG_NONNULL ((1, 3, 4))); | |
1182 | _GL_CXXALIAS_RPL (wcsftime, size_t, | |
1183 | (wchar_t *restrict __buf, size_t __bufsize, | |
1184 | const wchar_t *restrict __fmt, | |
1185 | const struct tm *restrict __tp)); | |
1050 | 1186 | # else |
1051 | 1187 | # if !@HAVE_WCSFTIME@ |
1052 | _GL_FUNCDECL_SYS (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, | |
1053 | const wchar_t *__fmt, const struct tm *__tp) | |
1054 | _GL_ARG_NONNULL ((1, 3, 4))); | |
1055 | # endif | |
1056 | _GL_CXXALIAS_SYS (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, | |
1057 | const wchar_t *__fmt, const struct tm *__tp)); | |
1058 | # endif | |
1188 | _GL_FUNCDECL_SYS (wcsftime, size_t, | |
1189 | (wchar_t *restrict __buf, size_t __bufsize, | |
1190 | const wchar_t *restrict __fmt, | |
1191 | const struct tm *restrict __tp) | |
1192 | _GL_ARG_NONNULL ((1, 3, 4))); | |
1193 | # endif | |
1194 | _GL_CXXALIAS_SYS (wcsftime, size_t, | |
1195 | (wchar_t *restrict __buf, size_t __bufsize, | |
1196 | const wchar_t *restrict __fmt, | |
1197 | const struct tm *restrict __tp)); | |
1198 | # endif | |
1199 | # if __GLIBC__ >= 2 | |
1059 | 1200 | _GL_CXXALIASWARN (wcsftime); |
1201 | # endif | |
1060 | 1202 | #elif defined GNULIB_POSIXCHECK |
1061 | 1203 | # undef wcsftime |
1062 | 1204 | # if HAVE_RAW_DECL_WCSFTIME |
0 | 0 | /* Substitute for and wrapper around <unistd.h>. |
1 | Copyright (C) 2003-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2003-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software; you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU Lesser General Public License as published by |
20 | 20 | #endif |
21 | 21 | @PRAGMA_COLUMNS@ |
22 | 22 | |
23 | #ifdef _GL_INCLUDING_UNISTD_H | |
23 | #if @HAVE_UNISTD_H@ && defined _GL_INCLUDING_UNISTD_H | |
24 | 24 | /* Special invocation convention: |
25 | 25 | - On Mac OS X 10.3.9 we have a sequence of nested includes |
26 | 26 | <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h> |
51 | 51 | #define _@GUARD_PREFIX@_UNISTD_H |
52 | 52 | |
53 | 53 | /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ |
54 | #include <stddef.h> | |
54 | /* But avoid namespace pollution on glibc systems. */ | |
55 | #ifndef __GLIBC__ | |
56 | # include <stddef.h> | |
57 | #endif | |
55 | 58 | |
56 | 59 | /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ |
57 | 60 | /* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include |
67 | 70 | # include <stdio.h> |
68 | 71 | #endif |
69 | 72 | |
70 | /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */ | |
73 | /* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in | |
74 | <unistd.h>. */ | |
71 | 75 | /* But avoid namespace pollution on glibc systems. */ |
72 | #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \ | |
76 | #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \ | |
77 | && (defined __CYGWIN__ || defined __ANDROID__) \ | |
73 | 78 | && ! defined __GLIBC__ |
74 | 79 | # include <fcntl.h> |
75 | 80 | #endif |
112 | 117 | # include <netdb.h> |
113 | 118 | #endif |
114 | 119 | |
120 | /* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */ | |
121 | /* But avoid namespace pollution on glibc systems. */ | |
122 | #if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \ | |
123 | && !defined __GLIBC__ | |
124 | # include <sys/stat.h> | |
125 | #endif | |
126 | ||
115 | 127 | /* MSVC defines off_t in <sys/types.h>. |
116 | 128 | May also define off_t to a 64-bit type on native Windows. */ |
117 | #if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@ | |
118 | /* Get off_t. */ | |
129 | /* But avoid namespace pollution on glibc systems. */ | |
130 | #ifndef __GLIBC__ | |
131 | /* Get off_t, ssize_t. */ | |
119 | 132 | # include <sys/types.h> |
120 | 133 | #endif |
121 | 134 | |
122 | #if (@GNULIB_READ@ || @GNULIB_WRITE@ \ | |
123 | || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ | |
124 | || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK) | |
125 | /* Get ssize_t. */ | |
126 | # include <sys/types.h> | |
127 | #endif | |
128 | ||
129 | 135 | /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
130 | 136 | |
131 | 137 | /* The definition of _GL_ARG_NONNULL is copied here. */ |
134 | 140 | |
135 | 141 | |
136 | 142 | /* Get getopt(), optarg, optind, opterr, optopt. */ |
137 | #if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT | |
143 | #if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT | |
138 | 144 | # include <getopt-cdefs.h> |
139 | 145 | # include <getopt-pfx-core.h> |
140 | 146 | #endif |
246 | 252 | /* Declare overridden functions. */ |
247 | 253 | |
248 | 254 | |
249 | #if defined GNULIB_POSIXCHECK | |
255 | #if @GNULIB_ACCESS@ | |
256 | # if @REPLACE_ACCESS@ | |
257 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
258 | # undef access | |
259 | # define access rpl_access | |
260 | # endif | |
261 | _GL_FUNCDECL_RPL (access, int, (const char *file, int mode) | |
262 | _GL_ARG_NONNULL ((1))); | |
263 | _GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); | |
264 | # else | |
265 | _GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); | |
266 | # endif | |
267 | _GL_CXXALIASWARN (access); | |
268 | #elif defined GNULIB_POSIXCHECK | |
269 | # undef access | |
270 | # if HAVE_RAW_DECL_ACCESS | |
250 | 271 | /* The access() function is a security risk. */ |
251 | _GL_WARN_ON_USE (access, "the access function is a security risk - " | |
272 | _GL_WARN_ON_USE (access, "access does not always support X_OK - " | |
273 | "use gnulib module access for portability; " | |
274 | "also, this function is a security risk - " | |
252 | 275 | "use the gnulib module faccessat instead"); |
276 | # endif | |
253 | 277 | #endif |
254 | 278 | |
255 | 279 | |
270 | 294 | to GID (if GID is not -1). Follow symbolic links. |
271 | 295 | Return 0 if successful, otherwise -1 and errno set. |
272 | 296 | See the POSIX:2008 specification |
273 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */ | |
297 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */ | |
274 | 298 | # if @REPLACE_CHOWN@ |
275 | 299 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
276 | 300 | # undef chown |
321 | 345 | #endif |
322 | 346 | |
323 | 347 | |
348 | #if @GNULIB_COPY_FILE_RANGE@ | |
349 | # if !@HAVE_COPY_FILE_RANGE@ | |
350 | _GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, | |
351 | int ofd, off_t *opos, | |
352 | size_t len, unsigned flags)); | |
353 | _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, | |
354 | int ofd, off_t *opos, | |
355 | size_t len, unsigned flags)); | |
356 | # endif | |
357 | _GL_CXXALIASWARN (copy_file_range); | |
358 | #elif defined GNULIB_POSIXCHECK | |
359 | /* Assume copy_file_range is always declared. */ | |
360 | _GL_WARN_ON_USE (copy_file_range, | |
361 | "copy_file_range is unportable - " | |
362 | "use gnulib module copy_file_range for portability"); | |
363 | #endif | |
364 | ||
365 | ||
324 | 366 | #if @GNULIB_DUP@ |
325 | 367 | # if @REPLACE_DUP@ |
326 | 368 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
346 | 388 | NEWFD = OLDFD, otherwise close NEWFD first if it is open. |
347 | 389 | Return newfd if successful, otherwise -1 and errno set. |
348 | 390 | See the POSIX:2008 specification |
349 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */ | |
391 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */ | |
350 | 392 | # if @REPLACE_DUP2@ |
351 | 393 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
352 | 394 | # define dup2 rpl_dup2 |
501 | 543 | the given file descriptor is open. |
502 | 544 | Return 0 if successful, otherwise -1 and errno set. |
503 | 545 | See the POSIX:2008 specification |
504 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ | |
546 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ | |
505 | 547 | # if ! @HAVE_FCHDIR@ |
506 | 548 | _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); |
507 | 549 | |
562 | 604 | /* Synchronize changes to a file. |
563 | 605 | Return 0 if successful, otherwise -1 and errno set. |
564 | 606 | See POSIX:2008 specification |
565 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ | |
607 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ | |
566 | 608 | # if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@ |
567 | 609 | _GL_FUNCDECL_SYS (fdatasync, int, (int fd)); |
568 | 610 | # endif |
581 | 623 | /* Synchronize changes, including metadata, to a file. |
582 | 624 | Return 0 if successful, otherwise -1 and errno set. |
583 | 625 | See POSIX:2008 specification |
584 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ | |
626 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ | |
585 | 627 | # if !@HAVE_FSYNC@ |
586 | 628 | _GL_FUNCDECL_SYS (fsync, int, (int fd)); |
587 | 629 | # endif |
600 | 642 | /* Change the size of the file to which FD is opened to become equal to LENGTH. |
601 | 643 | Return 0 if successful, otherwise -1 and errno set. |
602 | 644 | See the POSIX:2008 specification |
603 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */ | |
645 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */ | |
604 | 646 | # if @REPLACE_FTRUNCATE@ |
605 | 647 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
606 | 648 | # undef ftruncate |
630 | 672 | Return BUF if successful, or NULL if the directory couldn't be determined |
631 | 673 | or SIZE was too small. |
632 | 674 | See the POSIX:2008 specification |
633 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. | |
675 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. | |
634 | 676 | Additionally, the gnulib module 'getcwd' guarantees the following GNU |
635 | 677 | extension: If BUF is NULL, an array is allocated with 'malloc'; the array |
636 | 678 | is SIZE bytes long, unless SIZE == 0, in which case it is as big as |
706 | 748 | # if !@HAVE_GETDTABLESIZE@ |
707 | 749 | _GL_FUNCDECL_SYS (getdtablesize, int, (void)); |
708 | 750 | # endif |
709 | _GL_CXXALIAS_SYS (getdtablesize, int, (void)); | |
751 | /* Need to cast, because on AIX, the parameter list is | |
752 | (...). */ | |
753 | _GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void)); | |
710 | 754 | # endif |
711 | 755 | _GL_CXXALIASWARN (getdtablesize); |
712 | 756 | #elif defined GNULIB_POSIXCHECK |
790 | 834 | /* Returns the user's login name, or NULL if it cannot be found. Upon error, |
791 | 835 | returns NULL with errno set. |
792 | 836 | |
793 | See <http://www.opengroup.org/susv3xsh/getlogin.html>. | |
837 | See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>. | |
794 | 838 | |
795 | 839 | Most programs don't need to use this function, because the information is |
796 | 840 | available through environment variables: |
819 | 863 | the case that the login name cannot be found but no specific error is |
820 | 864 | provided (this case is hopefully rare but is left open by the POSIX spec). |
821 | 865 | |
822 | See <http://www.opengroup.org/susv3xsh/getlogin.html>. | |
866 | See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>. | |
823 | 867 | |
824 | 868 | Most programs don't need to use this function, because the information is |
825 | 869 | available through environment variables: |
860 | 904 | _GL_FUNCDECL_RPL (getpagesize, int, (void)); |
861 | 905 | _GL_CXXALIAS_RPL (getpagesize, int, (void)); |
862 | 906 | # else |
907 | /* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if | |
908 | the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */ | |
909 | # if defined __hpux | |
910 | _GL_FUNCDECL_SYS (getpagesize, int, (void)); | |
911 | # endif | |
863 | 912 | # if !@HAVE_GETPAGESIZE@ |
864 | 913 | # if !defined getpagesize |
865 | 914 | /* This is for POSIX systems. */ |
1054 | 1103 | to GID (if GID is not -1). Do not follow symbolic links. |
1055 | 1104 | Return 0 if successful, otherwise -1 and errno set. |
1056 | 1105 | See the POSIX:2008 specification |
1057 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */ | |
1106 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */ | |
1058 | 1107 | # if @REPLACE_LCHOWN@ |
1059 | 1108 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1060 | 1109 | # undef lchown |
1084 | 1133 | /* Create a new hard link for an existing file. |
1085 | 1134 | Return 0 if successful, otherwise -1 and errno set. |
1086 | 1135 | See POSIX:2008 specification |
1087 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */ | |
1136 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */ | |
1088 | 1137 | # if @REPLACE_LINK@ |
1089 | 1138 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1090 | 1139 | # define link rpl_link |
1150 | 1199 | /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. |
1151 | 1200 | Return the new offset if successful, otherwise -1 and errno set. |
1152 | 1201 | See the POSIX:2008 specification |
1153 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */ | |
1202 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */ | |
1154 | 1203 | # if @REPLACE_LSEEK@ |
1155 | 1204 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1156 | 1205 | # define lseek rpl_lseek |
1222 | 1271 | Return the number of bytes placed into BUF if successful, otherwise |
1223 | 1272 | set errno and return -1. 0 indicates EOF. |
1224 | 1273 | See the POSIX:2008 specification |
1225 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */ | |
1274 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */ | |
1226 | 1275 | # if @REPLACE_PREAD@ |
1227 | 1276 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1228 | 1277 | # undef pread |
1257 | 1306 | Return the number of bytes written if successful, otherwise |
1258 | 1307 | set errno and return -1. 0 indicates nothing written. See the |
1259 | 1308 | POSIX:2008 specification |
1260 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */ | |
1309 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */ | |
1261 | 1310 | # if @REPLACE_PWRITE@ |
1262 | 1311 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1263 | 1312 | # undef pwrite |
1290 | 1339 | #if @GNULIB_READ@ |
1291 | 1340 | /* Read up to COUNT bytes from file descriptor FD into the buffer starting |
1292 | 1341 | at BUF. See the POSIX:2008 specification |
1293 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */ | |
1342 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */ | |
1294 | 1343 | # if @REPLACE_READ@ |
1295 | 1344 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1296 | 1345 | # undef read |
1314 | 1363 | bytes of it into BUF. Return the number of bytes placed into BUF if |
1315 | 1364 | successful, otherwise -1 and errno set. |
1316 | 1365 | See the POSIX:2008 specification |
1317 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */ | |
1366 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */ | |
1318 | 1367 | # if @REPLACE_READLINK@ |
1319 | 1368 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1320 | 1369 | # define readlink rpl_readlink |
1321 | 1370 | # endif |
1322 | 1371 | _GL_FUNCDECL_RPL (readlink, ssize_t, |
1323 | (const char *file, char *buf, size_t bufsize) | |
1372 | (const char *restrict file, | |
1373 | char *restrict buf, size_t bufsize) | |
1324 | 1374 | _GL_ARG_NONNULL ((1, 2))); |
1325 | 1375 | _GL_CXXALIAS_RPL (readlink, ssize_t, |
1326 | (const char *file, char *buf, size_t bufsize)); | |
1376 | (const char *restrict file, | |
1377 | char *restrict buf, size_t bufsize)); | |
1327 | 1378 | # else |
1328 | 1379 | # if !@HAVE_READLINK@ |
1329 | 1380 | _GL_FUNCDECL_SYS (readlink, ssize_t, |
1330 | (const char *file, char *buf, size_t bufsize) | |
1381 | (const char *restrict file, | |
1382 | char *restrict buf, size_t bufsize) | |
1331 | 1383 | _GL_ARG_NONNULL ((1, 2))); |
1332 | 1384 | # endif |
1333 | 1385 | _GL_CXXALIAS_SYS (readlink, ssize_t, |
1334 | (const char *file, char *buf, size_t bufsize)); | |
1386 | (const char *restrict file, | |
1387 | char *restrict buf, size_t bufsize)); | |
1335 | 1388 | # endif |
1336 | 1389 | _GL_CXXALIASWARN (readlink); |
1337 | 1390 | #elif defined GNULIB_POSIXCHECK |
1349 | 1402 | # define readlinkat rpl_readlinkat |
1350 | 1403 | # endif |
1351 | 1404 | _GL_FUNCDECL_RPL (readlinkat, ssize_t, |
1352 | (int fd, char const *file, char *buf, size_t len) | |
1405 | (int fd, char const *restrict file, | |
1406 | char *restrict buf, size_t len) | |
1353 | 1407 | _GL_ARG_NONNULL ((2, 3))); |
1354 | 1408 | _GL_CXXALIAS_RPL (readlinkat, ssize_t, |
1355 | (int fd, char const *file, char *buf, size_t len)); | |
1409 | (int fd, char const *restrict file, | |
1410 | char *restrict buf, size_t len)); | |
1356 | 1411 | # else |
1357 | 1412 | # if !@HAVE_READLINKAT@ |
1358 | 1413 | _GL_FUNCDECL_SYS (readlinkat, ssize_t, |
1359 | (int fd, char const *file, char *buf, size_t len) | |
1414 | (int fd, char const *restrict file, | |
1415 | char *restrict buf, size_t len) | |
1360 | 1416 | _GL_ARG_NONNULL ((2, 3))); |
1361 | 1417 | # endif |
1362 | 1418 | _GL_CXXALIAS_SYS (readlinkat, ssize_t, |
1363 | (int fd, char const *file, char *buf, size_t len)); | |
1419 | (int fd, char const *restrict file, | |
1420 | char *restrict buf, size_t len)); | |
1364 | 1421 | # endif |
1365 | 1422 | _GL_CXXALIASWARN (readlinkat); |
1366 | 1423 | #elif defined GNULIB_POSIXCHECK |
1424 | 1481 | /* Pause the execution of the current thread for N seconds. |
1425 | 1482 | Returns the number of seconds left to sleep. |
1426 | 1483 | See the POSIX:2008 specification |
1427 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */ | |
1484 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */ | |
1428 | 1485 | # if @REPLACE_SLEEP@ |
1429 | 1486 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1430 | 1487 | # undef sleep |
1508 | 1565 | /* Change the size of the file designated by FILENAME to become equal to LENGTH. |
1509 | 1566 | Return 0 if successful, otherwise -1 and errno set. |
1510 | 1567 | See the POSIX:2008 specification |
1511 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */ | |
1568 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */ | |
1512 | 1569 | # if @REPLACE_TRUNCATE@ |
1513 | 1570 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1514 | 1571 | # undef truncate |
1615 | 1672 | /* Pause the execution of the current thread for N microseconds. |
1616 | 1673 | Returns 0 on completion, or -1 on range error. |
1617 | 1674 | See the POSIX:2001 specification |
1618 | <http://www.opengroup.org/susv3xsh/usleep.html>. */ | |
1675 | <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */ | |
1619 | 1676 | # if @REPLACE_USLEEP@ |
1620 | 1677 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1621 | 1678 | # undef usleep |
1627 | 1684 | # if !@HAVE_USLEEP@ |
1628 | 1685 | _GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); |
1629 | 1686 | # endif |
1630 | _GL_CXXALIAS_SYS (usleep, int, (useconds_t n)); | |
1687 | /* Need to cast, because on Haiku, the first parameter is | |
1688 | unsigned int n. */ | |
1689 | _GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n)); | |
1631 | 1690 | # endif |
1632 | 1691 | _GL_CXXALIASWARN (usleep); |
1633 | 1692 | #elif defined GNULIB_POSIXCHECK |
1642 | 1701 | #if @GNULIB_WRITE@ |
1643 | 1702 | /* Write up to COUNT bytes starting at BUF to file descriptor FD. |
1644 | 1703 | See the POSIX:2008 specification |
1645 | <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */ | |
1704 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */ | |
1646 | 1705 | # if @REPLACE_WRITE@ |
1647 | 1706 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1648 | 1707 | # undef write |
0 | 0 | /* A C macro for emitting warnings if a function is used. |
1 | Copyright (C) 2010-2018 Free Software Foundation, Inc. | |
1 | Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
2 | 2 | |
3 | 3 | This program is free software: you can redistribute it and/or modify it |
4 | 4 | under the terms of the GNU Lesser General Public License as published |
0 | 0 | # Process this file with autoconf to produce a pkg-config metadata file. |
1 | # Copyright 2002-2018 Simon Josefsson | |
1 | # Copyright 2002-2020 Simon Josefsson | |
2 | 2 | # |
3 | 3 | # Copying and distribution of this file, with or without modification, |
4 | 4 | # are permitted in any medium without royalty provided the copyright |
0 | 0 | Name: libntlm |
1 | Version: 1.5 | |
1 | Version: 1.6 | |
2 | 2 | Release: 1 |
3 | 3 | Group: Development/Libraries |
4 | 4 | Summary: Microsoft WinNT domain authentication library |
4062 | 4062 | if AC_TRY_EVAL(ac_compile); then |
4063 | 4063 | # Now try to grab the symbols. |
4064 | 4064 | nlist=conftest.nm |
4065 | if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then | |
4065 | $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD | |
4066 | if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then | |
4066 | 4067 | # Try sorting and uniquifying the output. |
4067 | 4068 | if sort "$nlist" | uniq > "$nlist"T; then |
4068 | 4069 | mv -f "$nlist"T "$nlist" |
6437 | 6438 | # Commands to make compiler produce verbose output that lists |
6438 | 6439 | # what "hidden" libraries, object files and flags are used when |
6439 | 6440 | # linking a shared library. |
6440 | output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' | |
6441 | output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' | |
6441 | 6442 | |
6442 | 6443 | else |
6443 | 6444 | GXX=no |
6812 | 6813 | # explicitly linking system object files so we need to strip them |
6813 | 6814 | # from the output so that they don't get included in the library |
6814 | 6815 | # dependencies. |
6815 | output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' | |
6816 | output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' | |
6816 | 6817 | ;; |
6817 | 6818 | *) |
6818 | 6819 | if test yes = "$GXX"; then |
6877 | 6878 | # explicitly linking system object files so we need to strip them |
6878 | 6879 | # from the output so that they don't get included in the library |
6879 | 6880 | # dependencies. |
6880 | output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' | |
6881 | output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' | |
6881 | 6882 | ;; |
6882 | 6883 | *) |
6883 | 6884 | if test yes = "$GXX"; then |
7216 | 7217 | # Commands to make compiler produce verbose output that lists |
7217 | 7218 | # what "hidden" libraries, object files and flags are used when |
7218 | 7219 | # linking a shared library. |
7219 | output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' | |
7220 | output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' | |
7220 | 7221 | |
7221 | 7222 | else |
7222 | 7223 | # FIXME: insert proper C++ library support |
7300 | 7301 | # Commands to make compiler produce verbose output that lists |
7301 | 7302 | # what "hidden" libraries, object files and flags are used when |
7302 | 7303 | # linking a shared library. |
7303 | output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' | |
7304 | output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' | |
7304 | 7305 | else |
7305 | 7306 | # g++ 2.7 appears to require '-G' NOT '-shared' on this |
7306 | 7307 | # platform. |
7311 | 7312 | # Commands to make compiler produce verbose output that lists |
7312 | 7313 | # what "hidden" libraries, object files and flags are used when |
7313 | 7314 | # linking a shared library. |
7314 | output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' | |
7315 | output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' | |
7315 | 7316 | fi |
7316 | 7317 | |
7317 | 7318 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' |
1 | 1 | # This Makefile fragment tries to be general-purpose enough to be |
2 | 2 | # used by many projects via the gnulib maintainer-makefile module. |
3 | 3 | |
4 | ## Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
4 | ## Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
5 | 5 | ## |
6 | 6 | ## This program is free software: you can redistribute it and/or modify |
7 | 7 | ## it under the terms of the GNU General Public License as published by |
20 | 20 | # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) |
21 | 21 | ME := maint.mk |
22 | 22 | |
23 | # These variables ought to be defined through the configure.ac section | |
24 | # of the module description. But some packages import this file directly, | |
25 | # ignoring the module description. | |
26 | AWK ?= awk | |
27 | GREP ?= grep | |
28 | SED ?= sed | |
29 | ||
23 | 30 | # Helper variables. |
24 | 31 | _empty = |
25 | 32 | _sp = $(_empty) $(_empty) |
45 | 52 | # Do not save the original name or timestamp in the .tar.gz file. |
46 | 53 | # Use --rsyncable if available. |
47 | 54 | gzip_rsyncable := \ |
48 | $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \ | |
55 | $(shell gzip --help 2>/dev/null|$(GREP) rsyncable >/dev/null \ | |
49 | 56 | && printf %s --rsyncable) |
50 | 57 | GZIP_ENV = '--no-name --best $(gzip_rsyncable)' |
51 | 58 | |
82 | 89 | $(or $(exclude_file_name_regexp--$@),^$$) |
83 | 90 | VC_LIST_EXCEPT = \ |
84 | 91 | $(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ |
85 | | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \ | |
86 | else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \ | |
87 | | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \ | |
92 | | if test -f $(srcdir)/.x-$@; then $(GREP) -vEf $(srcdir)/.x-$@; \ | |
93 | else $(GREP) -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \ | |
94 | | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \ | |
88 | 95 | $(_prepend_srcdir_prefix) |
89 | 96 | |
90 | 97 | ifeq ($(origin prev_version_file), undefined) |
183 | 190 | @end=$$(date +%s.%N); \ |
184 | 191 | start=$$(cat .sc-start-$*); \ |
185 | 192 | rm -f .sc-start-$*; \ |
186 | awk -v s=$$start -v e=$$end \ | |
193 | $(AWK) -v s=$$start -v e=$$end \ | |
187 | 194 | 'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null |
188 | 195 | |
189 | 196 | # The patsubst here is to replace each sc_% rule with its sc_%.z wrapper |
291 | 298 | \ |
292 | 299 | : Filter by file name; \ |
293 | 300 | if test -n "$$in_files"; then \ |
294 | files=$$(find $(srcdir) | grep -E "$$in_files" \ | |
295 | | grep -Ev '$(_sc_excl)'); \ | |
301 | files=$$(find $(srcdir) | $(GREP) -E "$$in_files" \ | |
302 | | $(GREP) -Ev '$(_sc_excl)'); \ | |
296 | 303 | else \ |
297 | 304 | files=$$($(VC_LIST_EXCEPT)); \ |
298 | 305 | if test -n "$$in_vc_files"; then \ |
299 | files=$$(echo "$$files" | grep -E "$$in_vc_files"); \ | |
306 | files=$$(echo "$$files" | $(GREP) -E "$$in_vc_files"); \ | |
300 | 307 | fi; \ |
301 | 308 | fi; \ |
302 | 309 | \ |
303 | 310 | : Filter by content; \ |
304 | test -n "$$files" && test -n "$$containing" \ | |
305 | && { files=$$(grep -l "$$containing" $$files); } || :; \ | |
306 | test -n "$$files" && test -n "$$non_containing" \ | |
307 | && { files=$$(grep -vl "$$non_containing" $$files); } || :; \ | |
311 | test -n "$$files" \ | |
312 | && test -n "$$containing" \ | |
313 | && { files=$$(echo "$$files" | xargs $(GREP) -l "$$containing"); } \ | |
314 | || :; \ | |
315 | test -n "$$files" \ | |
316 | && test -n "$$non_containing" \ | |
317 | && { files=$$(echo "$$files" | xargs $(GREP) -vl "$$non_containing"); } \ | |
318 | || :; \ | |
308 | 319 | \ |
309 | 320 | : Check for the construct; \ |
310 | 321 | if test -n "$$files"; then \ |
311 | 322 | if test -n "$$prohibit"; then \ |
312 | grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \ | |
313 | | grep -vE "$${exclude:-^$$}" \ | |
314 | && { msg="$$halt" $(_sc_say_and_exit) } || :; \ | |
323 | echo "$$files" \ | |
324 | | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE \ | |
325 | "$$prohibit" /dev/null \ | |
326 | | $(GREP) -vE "$${exclude:-^$$}" \ | |
327 | && { msg="$$halt" $(_sc_say_and_exit) } \ | |
328 | || :; \ | |
315 | 329 | else \ |
316 | grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \ | |
317 | | grep . \ | |
318 | && { msg="$$halt" $(_sc_say_and_exit) } || :; \ | |
330 | echo "$$files" \ | |
331 | | xargs \ | |
332 | $(GREP) $$with_grep_options $(_ignore_case) -LE "$$require" \ | |
333 | | $(GREP) . \ | |
334 | && { msg="$$halt" $(_sc_say_and_exit) } \ | |
335 | || :; \ | |
319 | 336 | fi \ |
320 | 337 | else :; \ |
321 | 338 | fi || :; |
322 | 339 | endef |
323 | 340 | |
324 | 341 | sc_avoid_if_before_free: |
325 | @$(srcdir)/$(_build-aux)/useless-if-before-free \ | |
326 | $(useless_free_options) \ | |
327 | $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \ | |
328 | { echo '$(ME): found useless "if" before "free" above' 1>&2; \ | |
329 | exit 1; } || : | |
342 | @$(VC_LIST_EXCEPT) \ | |
343 | | $(GREP) -v useless-if-before-free \ | |
344 | | xargs \ | |
345 | $(srcdir)/$(_build-aux)/useless-if-before-free \ | |
346 | $(useless_free_options) \ | |
347 | && { printf '$(ME): found useless "if"' \ | |
348 | ' before "free" above\n' 1>&2; \ | |
349 | exit 1; } \ | |
350 | || : | |
330 | 351 | |
331 | 352 | sc_cast_of_argument_to_free: |
332 | 353 | @prohibit='\<free *\( *\(' halt="don't cast free argument" \ |
387 | 408 | halt='use EXIT_* values rather than magic number' \ |
388 | 409 | $(_sc_search_regexp) |
389 | 410 | |
411 | # Check that we don't use $< in non-implicit Makefile rules. | |
412 | # | |
413 | # To find the Makefiles, trace AC_CONFIG_FILES. Using VC_LIST would | |
414 | # miss the Makefiles that are not under VC control (e.g., symlinks | |
415 | # installed for gettext). "Parsing" (recursive) uses of SUBDIRS seems | |
416 | # too delicate. | |
417 | # | |
418 | # Use GNU Make's --print-data-base to normalize the rules into some | |
419 | # easy to parse format: they are separated by two \n. Look for the | |
420 | # "section" about non-pattern rules (marked with "# Files") inside | |
421 | # which there are still the POSIX Make like implicit rules (".c.o"). | |
422 | sc_prohibit_gnu_make_extensions_awk_ = \ | |
423 | BEGIN { \ | |
424 | RS = "\n\n"; \ | |
425 | in_rules = 0; \ | |
426 | } \ | |
427 | /^\# Files/ { \ | |
428 | in_rules = 1; \ | |
429 | } \ | |
430 | /\$$</ && in_rules && $$0 !~ /^(.*\n)*\.\w+(\.\w+)?:/ { \ | |
431 | print "Error: " file ": $$< in a non implicit rule\n" $$0; \ | |
432 | status = 1; \ | |
433 | } \ | |
434 | END { \ | |
435 | exit status; \ | |
436 | } | |
437 | sc_prohibit_gnu_make_extensions: | |
438 | @if $(AWK) --version | grep GNU >/dev/null 2>&1; then \ | |
439 | (cd $(srcdir) && autoconf --trace AC_CONFIG_FILES:'$$1') | \ | |
440 | tr ' ' '\n' | \ | |
441 | $(SED) -ne '/Makefile/{s/\.in$$//;p;}' | \ | |
442 | while read m; do \ | |
443 | $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null | \ | |
444 | $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1; \ | |
445 | done; \ | |
446 | fi | |
447 | ||
390 | 448 | # Using EXIT_SUCCESS as the first argument to error is misleading, |
391 | 449 | # since when that parameter is 0, error does not exit. Use '0' instead. |
392 | 450 | sc_error_exit_success: |
398 | 456 | # "FATAL:" should be fully upper-cased in error messages |
399 | 457 | # "WARNING:" should be fully upper-cased, or fully lower-cased |
400 | 458 | sc_error_message_warn_fatal: |
401 | @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ | |
402 | | grep -E '"Warning|"Fatal|"fatal' && \ | |
403 | { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \ | |
404 | exit 1; } || : | |
459 | @$(VC_LIST_EXCEPT) \ | |
460 | | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ | |
461 | | $(GREP) -E '"Warning|"Fatal|"fatal' \ | |
462 | && { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \ | |
463 | exit 1; } \ | |
464 | || : | |
405 | 465 | |
406 | 466 | # Error messages should not start with a capital letter |
407 | 467 | sc_error_message_uppercase: |
408 | @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ | |
409 | | grep -E '"[A-Z]' \ | |
410 | | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \ | |
411 | { echo '$(ME): found capitalized error message' 1>&2; \ | |
412 | exit 1; } || : | |
468 | @$(VC_LIST_EXCEPT) \ | |
469 | | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ | |
470 | | $(GREP) -E '"[A-Z]' \ | |
471 | | $(GREP) -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' \ | |
472 | && { echo '$(ME): found capitalized error message' 1>&2; \ | |
473 | exit 1; } \ | |
474 | || : | |
413 | 475 | |
414 | 476 | # Error messages should not end with a period |
415 | 477 | sc_error_message_period: |
416 | @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \ | |
417 | | grep -E '[^."]\."' && \ | |
418 | { echo '$(ME): found error message ending in period' 1>&2; \ | |
419 | exit 1; } || : | |
478 | @$(VC_LIST_EXCEPT) \ | |
479 | | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ | |
480 | | $(GREP) -E '[^."]\."' \ | |
481 | && { echo '$(ME): found error message ending in period' 1>&2; \ | |
482 | exit 1; } \ | |
483 | || : | |
420 | 484 | |
421 | 485 | sc_file_system: |
422 | 486 | @prohibit=file''system \ |
458 | 522 | # You must include <config.h> before including any other header file. |
459 | 523 | # This can possibly be via a package-specific header, if given by cfg.mk. |
460 | 524 | sc_require_config_h_first: |
461 | @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ | |
462 | files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') && \ | |
525 | @if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ | |
526 | files=$$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$') && \ | |
463 | 527 | perl -n $(perl_config_h_first_) $$files || \ |
464 | 528 | { echo '$(ME): the above files include some other header' \ |
465 | 529 | 'before <config.h>' 1>&2; exit 1; } || :; \ |
477 | 541 | define _sc_header_without_use |
478 | 542 | dummy=; : so we do not need a semicolon before each use; \ |
479 | 543 | h_esc=`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \ |
480 | if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ | |
481 | files=$$(grep -l '^# *include '"$$h_esc" \ | |
482 | $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \ | |
483 | grep -LE "$$re" $$files | grep . && \ | |
544 | if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ | |
545 | files=$$($(GREP) -l '^# *include '"$$h_esc" \ | |
546 | $$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$')) && \ | |
547 | $(GREP) -LE "$$re" $$files | $(GREP) . && \ | |
484 | 548 | { echo "$(ME): the above files include $$h but don't use it" \ |
485 | 549 | 1>&2; exit 1; } || :; \ |
486 | 550 | else :; \ |
510 | 574 | |
511 | 575 | # Don't include this header unless you use one of its functions. |
512 | 576 | sc_prohibit_long_options_without_use: |
513 | @h='long-options.h' re='\<parse_long_options *\(' \ | |
577 | @h='long-options.h' re='\<parse_(long_options|gnu_standard_options_only) *\(' \ | |
514 | 578 | $(_sc_header_without_use) |
515 | 579 | |
516 | 580 | # Don't include this header unless you use one of its functions. |
571 | 635 | @h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use) |
572 | 636 | |
573 | 637 | sc_prohibit_same_without_use: |
574 | @h='same.h' re='\<same_name *\(' $(_sc_header_without_use) | |
638 | @h='same.h' re='\<same_name(at)? *\(' $(_sc_header_without_use) | |
575 | 639 | |
576 | 640 | sc_prohibit_hash_pjw_without_use: |
577 | 641 | @h='hash-pjw.h' \ |
584 | 648 | |
585 | 649 | sc_prohibit_argmatch_without_use: |
586 | 650 | @h='argmatch.h' \ |
587 | re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \ | |
651 | re='(\<(ARGMATCH_DEFINE_GROUP|ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \ | |
588 | 652 | $(_sc_header_without_use) |
589 | 653 | |
590 | 654 | sc_prohibit_canonicalize_without_use: |
734 | 798 | sc_require_test_exit_idiom: |
735 | 799 | @if test -f $(srcdir)/$(Exit_witness_file); then \ |
736 | 800 | die=0; \ |
737 | for i in $$(grep -l -F 'srcdir/$(Exit_base)' \ | |
801 | for i in $$($(GREP) -l -F 'srcdir/$(Exit_base)' \ | |
738 | 802 | $$($(VC_LIST) tests)); do \ |
739 | tail -n1 $$i | grep '^Exit .' > /dev/null \ | |
803 | tail -n1 $$i | $(GREP) '^Exit .' > /dev/null \ | |
740 | 804 | && : || { die=1; echo $$i; } \ |
741 | 805 | done; \ |
742 | 806 | test $$die = 1 && \ |
841 | 905 | # Don't define macros that we already get from gnulib header files. |
842 | 906 | sc_prohibit_always-defined_macros: |
843 | 907 | @if test -d $(gnulib_dir); then \ |
844 | case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \ | |
908 | case $$(echo all: | $(GREP) -l -f - Makefile) in Makefile);; *) \ | |
845 | 909 | echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \ |
846 | 910 | esac; \ |
847 | $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT)) \ | |
848 | && { echo '$(ME): define the above via some gnulib .h file' \ | |
849 | 1>&2; exit 1; } || :; \ | |
911 | regex=$$($(def_sym_regex)); export regex; \ | |
912 | $(VC_LIST_EXCEPT) \ | |
913 | | xargs sh -c 'echo $$regex | $(GREP) -E -f - "$$@"' \ | |
914 | dummy /dev/null \ | |
915 | && { printf '$(ME): define the above' \ | |
916 | ' via some gnulib .h file\n' 1>&2; \ | |
917 | exit 1; } \ | |
918 | || :; \ | |
850 | 919 | fi |
851 | 920 | # ================================================================== |
852 | 921 | |
853 | 922 | # Prohibit checked in backup files. |
854 | 923 | sc_prohibit_backup_files: |
855 | @$(VC_LIST) | grep '~$$' && \ | |
924 | @$(VC_LIST) | $(GREP) '~$$' && \ | |
856 | 925 | { echo '$(ME): found version controlled backup file' 1>&2; \ |
857 | 926 | exit 1; } || : |
858 | 927 | |
926 | 995 | } \ |
927 | 996 | END { exit defined $$fail } |
928 | 997 | sc_prohibit_empty_lines_at_EOF: |
929 | @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \ | |
930 | || { echo '$(ME): empty line(s) or no newline at EOF' \ | |
931 | 1>&2; exit 1; } || : | |
998 | @$(VC_LIST_EXCEPT) \ | |
999 | | xargs perl -le '$(require_exactly_one_NL_at_EOF_)' \ | |
1000 | || { echo '$(ME): empty line(s) or no newline at EOF' 1>&2; \ | |
1001 | exit 1; } \ | |
1002 | || : | |
932 | 1003 | |
933 | 1004 | # Make sure we don't use st_blocks. Use ST_NBLOCKS instead. |
934 | 1005 | # This is a bit of a kludge, since it prevents use of the string |
971 | 1042 | ignore_doubled_word_match_RE_ ?= ^$$ |
972 | 1043 | |
973 | 1044 | sc_prohibit_doubled_word: |
974 | @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \ | |
975 | | grep -vE '$(ignore_doubled_word_match_RE_)' \ | |
976 | | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || : | |
1045 | @$(VC_LIST_EXCEPT) \ | |
1046 | | xargs perl -n -0777 $(prohibit_doubled_word_) \ | |
1047 | | $(GREP) -vE '$(ignore_doubled_word_match_RE_)' \ | |
1048 | | $(GREP) . \ | |
1049 | && { echo '$(ME): doubled words' 1>&2; exit 1; } \ | |
1050 | || : | |
977 | 1051 | |
978 | 1052 | # A regular expression matching undesirable combinations of words like |
979 | 1053 | # "can not"; this matches them even when the two words appear on different |
997 | 1071 | ignore_undesirable_word_sequence_RE_ ?= ^$$ |
998 | 1072 | |
999 | 1073 | sc_prohibit_undesirable_word_seq: |
1000 | @perl -n -0777 $(prohibit_undesirable_word_seq_) \ | |
1001 | $$($(VC_LIST_EXCEPT)) \ | |
1002 | | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \ | |
1003 | && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || : | |
1074 | @$(VC_LIST_EXCEPT) \ | |
1075 | | xargs perl -n -0777 $(prohibit_undesirable_word_seq_) \ | |
1076 | | $(GREP) -vE '$(ignore_undesirable_word_sequence_RE_)' \ | |
1077 | | $(GREP) . \ | |
1078 | && { echo '$(ME): undesirable word sequence' >&2; exit 1; } \ | |
1079 | || : | |
1004 | 1080 | |
1005 | 1081 | # Except for shell files and for loops, double semicolon is probably a mistake |
1006 | 1082 | sc_prohibit_double_semicolon: |
1032 | 1108 | # definition of LDADD from the appropriate Makefile.am and exits 0 |
1033 | 1109 | # when it contains "ICONV". |
1034 | 1110 | sc_proper_name_utf8_requires_ICONV: |
1035 | @progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\ | |
1111 | @progs=$$($(VC_LIST_EXCEPT) \ | |
1112 | | xargs $(GREP) -l 'proper_name_utf8 ''("'); \ | |
1036 | 1113 | if test "x$$progs" != x; then \ |
1037 | 1114 | fail=0; \ |
1038 | 1115 | for p in $$progs; do \ |
1041 | 1118 | -ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)' \ |
1042 | 1119 | $$dir/Makefile.am && continue; \ |
1043 | 1120 | base=$$(basename "$$p" .c); \ |
1044 | grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \ | |
1121 | $(GREP) "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \ | |
1045 | 1122 | || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \ |
1046 | 1123 | done; \ |
1047 | 1124 | test $$fail = 1 && \ |
1102 | 1179 | -e ' && !/(\w+)\s+=.*\@\1\@$$/' \ |
1103 | 1180 | -e ''$(_makefile_at_at_check_exceptions) \ |
1104 | 1181 | -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \ |
1105 | $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \ | |
1182 | $$($(VC_LIST_EXCEPT) | $(GREP) -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \ | |
1106 | 1183 | && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || : |
1107 | 1184 | |
1108 | 1185 | news-check: NEWS |
1109 | 1186 | $(AM_V_GEN)if $(SED) -n $(news-check-lines-spec)p $< \ |
1110 | | grep -E $(news-check-regexp) >/dev/null; then \ | |
1187 | | $(GREP) -E $(news-check-regexp) >/dev/null; then \ | |
1111 | 1188 | :; \ |
1112 | 1189 | else \ |
1113 | 1190 | echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \ |
1152 | 1229 | _gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$) |
1153 | 1230 | sc_po_check: |
1154 | 1231 | @if test -f $(po_file); then \ |
1155 | grep -E -v '^(#|$$)' $(po_file) \ | |
1156 | | grep -v '^src/false\.c$$' | sort > $@-1; \ | |
1157 | files=$$(perl $(perl_translatable_files_list_) \ | |
1158 | $$($(VC_LIST_EXCEPT)) $(generated_files)); \ | |
1159 | grep -E -l '$(_gl_translatable_string_re)' $$files \ | |
1160 | | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \ | |
1232 | $(GREP) -E -v '^(#|$$)' $(po_file) \ | |
1233 | | $(GREP) -v '^src/false\.c$$' | sort > $@-1; \ | |
1234 | { $(VC_LIST_EXCEPT); echo $(generated_files); } \ | |
1235 | | xargs perl $(perl_translatable_files_list_) \ | |
1236 | | xargs $(GREP) -E -l '$(_gl_translatable_string_re)' \ | |
1237 | | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ | |
1238 | | sort -u > $@-2; \ | |
1161 | 1239 | diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ |
1162 | 1240 | || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \ |
1163 | 1241 | rm -f $@-1 $@-2; \ |
1221 | 1299 | _hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh" |
1222 | 1300 | sc_cross_check_PATH_usage_in_tests: |
1223 | 1301 | @if test -f $(_hv_file); then \ |
1224 | grep -l 'VERSION mismatch' $(_hv_file) >/dev/null \ | |
1302 | $(GREP) -l 'VERSION mismatch' $(_hv_file) >/dev/null \ | |
1225 | 1303 | || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2; \ |
1226 | 1304 | exit 0; }; \ |
1227 | grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \ | |
1305 | $(GREP) -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \ | |
1228 | 1306 | || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \ |
1229 | 1307 | exit 1; }; \ |
1230 | good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file)); \ | |
1231 | grep -LFx "$$good" \ | |
1232 | $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT))) \ | |
1233 | | grep . && \ | |
1234 | { echo "$(ME): the above files use path_prepend_ inconsistently" \ | |
1235 | 1>&2; exit 1; } || :; \ | |
1308 | good=$$($(GREP) -E '$(_hv_regex_strong)' $(_hv_file)); \ | |
1309 | $(VC_LIST_EXCEPT) \ | |
1310 | | xargs $(GREP) -lE '$(_hv_regex_weak)' \ | |
1311 | | xargs $(GREP) -LFx "$$good" \ | |
1312 | | $(GREP) . \ | |
1313 | && { printf "$(ME): the above files use" \ | |
1314 | " path_prepend_ inconsistently\n" 1>&2; \ | |
1315 | exit 1; } \ | |
1316 | || :; \ | |
1236 | 1317 | fi |
1237 | 1318 | |
1238 | 1319 | # BRE regex of file contents to identify a test script. |
1304 | 1385 | $$(cd $(srcdir) \ |
1305 | 1386 | && git cat-file tag v$(VERSION) \ |
1306 | 1387 | | $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null \ |
1307 | | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}') | |
1388 | | $(AWK) '/^\[GNUPG:\] ERRSIG / {print $$3; exit}') | |
1308 | 1389 | |
1309 | 1390 | translation_project_ ?= coordinator@translationproject.org |
1310 | 1391 | |
1425 | 1506 | ALL_RECURSIVE_TARGETS += alpha beta stable |
1426 | 1507 | alpha beta stable: $(local-check) writable-files $(submodule-checks) |
1427 | 1508 | $(AM_V_GEN)test $@ = stable \ |
1428 | && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \ | |
1509 | && { echo $(VERSION) | $(GREP) -E '^[0-9]+(\.[0-9]+)+$$' \ | |
1429 | 1510 | || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\ |
1430 | 1511 | || : |
1431 | 1512 | $(AM_V_at)$(MAKE) vc-diff-check |
1523 | 1604 | -e 'END{defined $$d and print $$d}' bootstrap.conf); \ |
1524 | 1605 | test -n "$$t" && gl=$$t; \ |
1525 | 1606 | fi; \ |
1526 | for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do \ | |
1607 | for diff in $$(cd $$gl; git ls-files | $(GREP) '\.diff$$'); do \ | |
1527 | 1608 | b=$$(printf %s "$$diff"|$(SED) 's/\.diff$$//'); \ |
1528 | 1609 | VERSION_CONTROL=none \ |
1529 | 1610 | patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1; \ |
1566 | 1647 | # in the file .x-update-copyright. |
1567 | 1648 | .PHONY: update-copyright |
1568 | 1649 | update-copyright: |
1569 | $(AM_V_GEN)grep -l -w Copyright \ | |
1650 | $(AM_V_GEN)$(GREP) -l -w Copyright \ | |
1570 | 1651 | $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \ |
1571 | 1652 | | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@ |
1572 | 1653 | |
1580 | 1661 | ALL_RECURSIVE_TARGETS += sc_tight_scope |
1581 | 1662 | sc_tight_scope: tight-scope.mk |
1582 | 1663 | @fail=0; \ |
1583 | if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \ | |
1664 | if ! $(GREP) '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \ | |
1584 | 1665 | > /dev/null \ |
1585 | && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \ | |
1666 | && ! $(GREP) -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \ | |
1586 | 1667 | > /dev/null 2>&1; then \ |
1587 | 1668 | echo '$(ME): skipping $@'; \ |
1588 | 1669 | else \ |
1654 | 1735 | hdr=`for f in $(_gl_TS_headers); do \ |
1655 | 1736 | test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ |
1656 | 1737 | ( printf '%s\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ |
1657 | grep -h -A1 '^extern .*[^;]$$' $$src \ | |
1658 | | grep -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \ | |
1738 | $(GREP) -h -A1 '^extern .*[^;]$$' $$src \ | |
1739 | | $(GREP) -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \ | |
1659 | 1740 | perl -lne \ |
1660 | 1741 | '$(_gl_TS_function_match) and print $$1' $$hdr; \ |
1661 | 1742 | ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ |
1662 | nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \ | |
1743 | nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|$(GREP) -Ev -f $$t \ | |
1663 | 1744 | && { echo the above functions should have static scope >&2; \ |
1664 | 1745 | exit 1; } || : ; \ |
1665 | 1746 | ( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars); \ |
1667 | 1748 | $$hdr $(_gl_TS_other_headers) \ |
1668 | 1749 | ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ |
1669 | 1750 | nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \ |
1670 | | sort -u | grep -Ev -f $$t \ | |
1751 | | sort -u | $(GREP) -Ev -f $$t \ | |
1671 | 1752 | && { echo the above variables should have static scope >&2; \ |
1672 | 1753 | exit 1; } || : |
1673 | 1754 | # TS-end |
33 | 33 | typedef unsigned int uint32; |
34 | 34 | typedef unsigned char uint8; |
35 | 35 | |
36 | #define NTLM_VERSION "1.5" | |
36 | #define NTLM_VERSION "1.6" | |
37 | ||
38 | #define NTLM_MSG_BUFSIZE 1024 | |
37 | 39 | |
38 | 40 | /* |
39 | 41 | * These structures are byte-order dependant, and should not |
54 | 56 | uint32 flags; |
55 | 57 | tSmbStrHeader user; |
56 | 58 | tSmbStrHeader domain; |
57 | uint8 buffer[1024]; | |
59 | uint8 buffer[NTLM_MSG_BUFSIZE]; | |
58 | 60 | uint32 bufIndex; |
59 | 61 | } tSmbNtlmAuthRequest; |
60 | 62 | |
67 | 69 | uint8 challengeData[8]; |
68 | 70 | uint8 reserved[8]; |
69 | 71 | tSmbStrHeader emptyString; |
70 | uint8 buffer[1024]; | |
72 | uint8 buffer[NTLM_MSG_BUFSIZE]; | |
71 | 73 | uint32 bufIndex; |
72 | 74 | } tSmbNtlmAuthChallenge; |
73 | 75 | |
83 | 85 | tSmbStrHeader uWks; |
84 | 86 | tSmbStrHeader sessionKey; |
85 | 87 | uint32 flags; |
86 | uint8 buffer[1024]; | |
88 | uint8 buffer[NTLM_MSG_BUFSIZE]; | |
87 | 89 | uint32 bufIndex; |
88 | 90 | } tSmbNtlmAuthResponse; |
89 | 91 |
35 | 35 | |
36 | 36 | #define NTLM_VERSION "@PACKAGE_VERSION@" |
37 | 37 | |
38 | #define NTLM_MSG_BUFSIZE 1024 | |
39 | ||
38 | 40 | /* |
39 | 41 | * These structures are byte-order dependant, and should not |
40 | 42 | * be manipulated except by the use of the routines provided |
54 | 56 | uint32 flags; |
55 | 57 | tSmbStrHeader user; |
56 | 58 | tSmbStrHeader domain; |
57 | uint8 buffer[1024]; | |
59 | uint8 buffer[NTLM_MSG_BUFSIZE]; | |
58 | 60 | uint32 bufIndex; |
59 | 61 | } tSmbNtlmAuthRequest; |
60 | 62 | |
67 | 69 | uint8 challengeData[8]; |
68 | 70 | uint8 reserved[8]; |
69 | 71 | tSmbStrHeader emptyString; |
70 | uint8 buffer[1024]; | |
72 | uint8 buffer[NTLM_MSG_BUFSIZE]; | |
71 | 73 | uint32 bufIndex; |
72 | 74 | } tSmbNtlmAuthChallenge; |
73 | 75 | |
83 | 85 | tSmbStrHeader uWks; |
84 | 86 | tSmbStrHeader sessionKey; |
85 | 87 | uint32 flags; |
86 | uint8 buffer[1024]; | |
88 | uint8 buffer[NTLM_MSG_BUFSIZE]; | |
87 | 89 | uint32 bufIndex; |
88 | 90 | } tSmbNtlmAuthResponse; |
89 | 91 |
0 | 0 | /* |
1 | * Copyright (C) 2005-2018 Simon Josefsson | |
1 | * Copyright (C) 2005-2020 Simon Josefsson | |
2 | 2 | * Copyright (C) 1998-1999 Brian Bruns |
3 | 3 | * Copyright (C) 2004 Frediano Ziglio |
4 | 4 | * |
0 | 0 | /* smbutil.c --- Main library functions. |
1 | * Copyright (C) 2002-2018 Simon Josefsson | |
1 | * Copyright (C) 2002-2020 Simon Josefsson | |
2 | 2 | * Copyright (C) 1999-2001 Grant Edwards |
3 | 3 | * Copyright (C) 2004 Frediano Ziglio |
4 | 4 | * |
45 | 45 | |
46 | 46 | /* |
47 | 47 | * Must be multiple of two |
48 | * We use a statis buffer of 1024 bytes for message | |
48 | * We use a statis buffer of NTLM_MSG_BUFSIZE [1024] bytes for message | |
49 | 49 | * At maximun we but 48 bytes (ntlm responses) and 3 unicode strings so |
50 | * NTLM_BUFSIZE * 3 + 48 <= 1024 | |
50 | * NTLM_BUFSIZE * 3 + 48 <= NTLM_MSG_BUFSIZE | |
51 | 51 | */ |
52 | 52 | #define NTLM_BUFSIZE 320 |
53 | 53 | |
69 | 69 | */ |
70 | 70 | #define AddBytes(ptr, header, buf, count) \ |
71 | 71 | { \ |
72 | ptr->header.len = ptr->header.maxlen = UI16LE(count); \ | |
72 | size_t count2 = count; \ | |
73 | if (count2 > NTLM_MSG_BUFSIZE - ptr->bufIndex) \ | |
74 | count2 = NTLM_MSG_BUFSIZE - ptr->bufIndex; \ | |
75 | ptr->header.len = ptr->header.maxlen = UI16LE(count2); \ | |
73 | 76 | ptr->header.offset = UI32LE((ptr->buffer - ((uint8*)ptr)) + ptr->bufIndex); \ |
74 | memcpy(ptr->buffer+ptr->bufIndex, buf, count); \ | |
75 | ptr->bufIndex += count; \ | |
77 | memcpy(ptr->buffer+ptr->bufIndex, buf, count2); \ | |
78 | ptr->bufIndex += count2; \ | |
76 | 79 | } |
77 | 80 | |
78 | 81 | #define AddString(ptr, header, string) \ |
0 | /* test_overflow.c --- Test for CVE-2019-17455 overflow bug for libntlm. | |
1 | * Copyright (C) 2020 Simon Josefsson | |
2 | * | |
3 | * This file is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU Lesser General Public License as | |
5 | * published by the Free Software Foundation; either version 2.1 of | |
6 | * the License, or (at your option) any later version. | |
7 | * | |
8 | * This file is distributed in the hope that it will be useful, but | |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
11 | * Lesser General Public License for more details. | |
12 | * | |
13 | * You should have received a copy of the GNU Lesser General Public | |
14 | * License along with this file; if not, write to the Free Software | |
15 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
16 | * 02110-1301, USA. | |
17 | * | |
18 | */ | |
19 | ||
20 | #include <config.h> | |
21 | ||
22 | #include <string.h> | |
23 | #include <stdio.h> | |
24 | ||
25 | #include "ntlm.h" | |
26 | ||
27 | int | |
28 | main (void) | |
29 | { | |
30 | char u[1024]; | |
31 | char d[1024]; | |
32 | char buf[sizeof (tSmbNtlmAuthRequest) + 5]; | |
33 | tSmbNtlmAuthRequest *request = (void*) &buf; | |
34 | size_t i; | |
35 | ||
36 | memset (u, '1', 1024); | |
37 | memset (d, '2', 1024); | |
38 | u[1023] = '\0'; | |
39 | d[1023] = '\0'; | |
40 | ||
41 | memset (buf, '3', sizeof (buf)); | |
42 | ||
43 | printf ("Before call:\n"); | |
44 | for (i = sizeof (tSmbNtlmAuthRequest) - 5; i < sizeof (buf); i++) | |
45 | printf ("str[end + %d] = %02x\n", | |
46 | (int) (i - sizeof (tSmbNtlmAuthRequest)), (unsigned int) buf[i]); | |
47 | ||
48 | buildSmbNtlmAuthRequest (request, u, d); | |
49 | ||
50 | printf ("After call:\n"); | |
51 | for (i = sizeof (tSmbNtlmAuthRequest) - 5; i < sizeof (buf); i++) | |
52 | printf ("str[end + %d] = %02x\n", | |
53 | (int) (i - sizeof (tSmbNtlmAuthRequest)), (unsigned int) buf[i]); | |
54 | ||
55 | for (i = sizeof (tSmbNtlmAuthRequest); i < sizeof (buf); i++) | |
56 | if (buf[i] != '3') | |
57 | return 1; | |
58 | ||
59 | return 0; | |
60 | } |