From 48fdda3ef9a45e88eeb7c1b77537a7b65a20bf76 Mon Sep 17 00:00:00 2001 From: Fabrice Le Fessant Date: Fri, 3 Jan 2025 15:26:33 +0100 Subject: [PATCH 1/7] add test for profiling EVALUATE bug --- tests/testsuite.src/run_misc.at | 161 ++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/tests/testsuite.src/run_misc.at b/tests/testsuite.src/run_misc.at index 69dfde687..a768ab95a 100644 --- a/tests/testsuite.src/run_misc.at +++ b/tests/testsuite.src/run_misc.at @@ -15251,3 +15251,164 @@ AT_CHECK([$COMPILE prog.cob]) AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [1.2345E-5 1.2345E-5], []) AT_CLEANUP + + +AT_SETUP([profiling and codegen]) +AT_KEYWORDS([cobc EVALUATE]) + +AT_DATA([main.cob], [ +IDENTIFICATION DIVISION. +PROGRAM-ID. Main. + +DATA DIVISION. +WORKING-STORAGE SECTION. + 01 STR PIC X(6) VALUE "..-..-". + 01 OFFSET BINARY-LONG UNSIGNED. + +PROCEDURE DIVISION. + MOVE 1 TO OFFSET + PERFORM UNTIL OFFSET > LENGTH OF STR + CALL "TestRecurse" USING STR OFFSET + END-PERFORM. + +END PROGRAM Main. + + +IDENTIFICATION DIVISION. +PROGRAM-ID. TestRecurse IS RECURSIVE. + +DATA DIVISION. +LINKAGE SECTION. + 01 LK-STR PIC X ANY LENGTH. + 01 LK-OFFSET BINARY-LONG UNSIGNED. + +PROCEDURE DIVISION USING LK-STR LK-OFFSET. + DISPLAY "LK-OFFSET: " LK-OFFSET + EVALUATE LK-STR(LK-OFFSET:1) + WHEN "." + ADD 1 TO LK-OFFSET + CALL "TestRecurse" USING LK-STR LK-OFFSET + WHEN OTHER + ADD 1 TO LK-OFFSET + END-EVALUATE. + +END PROGRAM TestRecurse. +]) + +AT_CHECK([$COMPILE --free main.cob]) + +AT_CHECK([$COBCRUN_DIRECT ./main], [0], +[LK-OFFSET: 0000000001 +LK-OFFSET: 0000000002 +LK-OFFSET: 0000000003 +LK-OFFSET: 0000000004 +LK-OFFSET: 0000000005 +LK-OFFSET: 0000000006 +]) + +AT_CHECK([$COMPILE --free -fprof main.cob]) + +AT_CHECK([$COBCRUN_DIRECT ./main], [0], +[LK-OFFSET: 0000000001 +LK-OFFSET: 0000000002 +LK-OFFSET: 0000000003 +LK-OFFSET: 0000000004 +LK-OFFSET: 0000000005 +LK-OFFSET: 0000000006 +]) +AT_DATA([main.cob], [ + IDENTIFICATION DIVISION. + PROGRAM-ID. Main. + + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 STR PIC X(6) VALUE "..-..-". + 01 OFFSET BINARY-LONG UNSIGNED. + + PROCEDURE DIVISION. + MOVE 1 TO OFFSET + PERFORM UNTIL OFFSET > LENGTH OF STR + CALL "TestRecurse" USING STR OFFSET + END-PERFORM. + + END PROGRAM Main. + + + IDENTIFICATION DIVISION. + PROGRAM-ID. TestRecurse IS RECURSIVE. + + DATA DIVISION. + LINKAGE SECTION. + 01 LK-STR. + 03 LK-CHR PIC X OCCURS 6 INDEXED BY LK-IDX. + 01 LK-OFFSET BINARY-LONG UNSIGNED. + + PROCEDURE DIVISION USING LK-STR LK-OFFSET. + DISPLAY "LK-OFFSET: " LK-OFFSET + SET LK-IDX TO LK-OFFSET + SEARCH LK-CHR + AT END + IF LK-OFFSET > 20 + GOBACK + END-IF + ADD 1 TO LK-OFFSET + CALL "TestRecurse" USING LK-STR LK-OFFSET + WHEN LK-CHR (LK-IDX) = "." + ADD 1 TO LK-OFFSET + END-SEARCH. + END PROGRAM TestRecurse. +]) + +AT_CHECK([$COMPILE --free main.cob]) + +AT_CHECK([$COBCRUN_DIRECT ./main], [0], +[LK-OFFSET: 0000000001 +LK-OFFSET: 0000000002 +LK-OFFSET: 0000000003 +LK-OFFSET: 0000000004 +LK-OFFSET: 0000000005 +LK-OFFSET: 0000000006 +LK-OFFSET: 0000000007 +LK-OFFSET: 0000000008 +LK-OFFSET: 0000000009 +LK-OFFSET: 0000000010 +LK-OFFSET: 0000000011 +LK-OFFSET: 0000000012 +LK-OFFSET: 0000000013 +LK-OFFSET: 0000000014 +LK-OFFSET: 0000000015 +LK-OFFSET: 0000000016 +LK-OFFSET: 0000000017 +LK-OFFSET: 0000000018 +LK-OFFSET: 0000000019 +LK-OFFSET: 0000000020 +LK-OFFSET: 0000000021 +]) + +AT_CHECK([$COMPILE --free -fprof main.cob]) + +AT_CHECK([$COBCRUN_DIRECT ./main], [0], +[LK-OFFSET: 0000000001 +LK-OFFSET: 0000000002 +LK-OFFSET: 0000000003 +LK-OFFSET: 0000000004 +LK-OFFSET: 0000000005 +LK-OFFSET: 0000000006 +LK-OFFSET: 0000000007 +LK-OFFSET: 0000000008 +LK-OFFSET: 0000000009 +LK-OFFSET: 0000000010 +LK-OFFSET: 0000000011 +LK-OFFSET: 0000000012 +LK-OFFSET: 0000000013 +LK-OFFSET: 0000000014 +LK-OFFSET: 0000000015 +LK-OFFSET: 0000000016 +LK-OFFSET: 0000000017 +LK-OFFSET: 0000000018 +LK-OFFSET: 0000000019 +LK-OFFSET: 0000000020 +LK-OFFSET: 0000000021 +]) + +AT_CLEANUP From f684913a1a6f1cbcffb343868a45a02041f0fb65 Mon Sep 17 00:00:00 2001 From: Fabrice Le Fessant Date: Fri, 3 Jan 2025 12:37:08 +0100 Subject: [PATCH 2/7] fix profiling bug --- cobc/ChangeLog | 12 +++++++++++- cobc/typeck.c | 22 +++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/cobc/ChangeLog b/cobc/ChangeLog index fea626e9a..0df59d1fe 100644 --- a/cobc/ChangeLog +++ b/cobc/ChangeLog @@ -1,5 +1,15 @@ -2022-12-08 Simon Sobisch +2025-01-03 Fabrice Le Fessant + + * typeck.c (build_evaluate, cb_check_needs_break): fix a bug where + EVALUATE fails in profiling mode. The reason was that a check for + a last GOTO statement is not correctly written, because it was + actually checking either a GOTO or not a statement, which was + evaluates to true for instructions added by profiling. Fixed by + checking only that the last statement is a GOTO. Also modify + cb_check_needs_break that uses the same code. + +2024-12-08 Simon Sobisch * cobc.c (process_command_line): fix leak for --copy and -include parsing diff --git a/cobc/typeck.c b/cobc/typeck.c index 280fa922d..af66ca8a1 100644 --- a/cobc/typeck.c +++ b/cobc/typeck.c @@ -797,6 +797,7 @@ static cb_tree cb_check_needs_break (cb_tree stmt) { cb_tree l; + int needs_a_break = 1 ; /* Check if last statement is GO TO */ for (l = stmt; l; l = CB_CHAIN (l)) { @@ -806,12 +807,15 @@ cb_check_needs_break (cb_tree stmt) } if (l && CB_VALUE (l) && CB_STATEMENT_P (CB_VALUE (l))) { l = CB_STATEMENT(CB_VALUE(l))->body; - if (l && CB_VALUE (l) && !CB_GOTO_P (CB_VALUE(l))) { - /* Append a break */ - l = cb_build_direct ("break;", 0); - return cb_list_add (stmt, l); + if (l && CB_VALUE (l) && CB_GOTO_P (CB_VALUE(l))) { + needs_a_break = 0; } } + + if (needs_a_break){ + l = cb_build_direct ("break;", 0); + return cb_list_add (stmt, l); + } return stmt; } @@ -10019,6 +10023,7 @@ build_evaluate (cb_tree subject_list, cb_tree case_list, cb_tree goto_end_label) cb_source_line = old_line; } else { + int need_end_goto = 1 ; c2 = stmt; /* Check if last statement is GO TO */ for (c3 = stmt; c3; c3 = CB_CHAIN (c3)) { @@ -10028,11 +10033,14 @@ build_evaluate (cb_tree subject_list, cb_tree case_list, cb_tree goto_end_label) } if (c3 && CB_VALUE (c3) && CB_STATEMENT_P (CB_VALUE (c3))) { c3 = CB_STATEMENT (CB_VALUE (c3))->body; - if (c3 && CB_VALUE (c3) && !CB_GOTO_P (CB_VALUE(c3))) { - /* Append the jump */ - c2 = cb_list_add (stmt, goto_end_label); + if (c3 && CB_VALUE (c3) && CB_GOTO_P (CB_VALUE(c3))) { + need_end_goto = 0 ; } } + if (need_end_goto){ + /* Append the jump */ + c2 = cb_list_add (stmt, goto_end_label); + } cb_emit (cb_build_if (cb_build_cond (c1), c2, NULL, STMT_WHEN)); build_evaluate (subject_list, CB_CHAIN (case_list), goto_end_label); } From e259ff7a88de31ef93bc2c0a62a9573e2bff8588 Mon Sep 17 00:00:00 2001 From: Fabrice Le Fessant Date: Tue, 7 Jan 2025 00:01:20 +0100 Subject: [PATCH 3/7] Fix INDEXED BY in LINKAGE SECTION Fix a bug where INDEXED BY in LINKAGE SECTION would cause the variable not to be added to the local include file, causing a compile error of the C code. --- cobc/ChangeLog | 6 ++++++ cobc/parser.y | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cobc/ChangeLog b/cobc/ChangeLog index 0df59d1fe..70be6aa26 100644 --- a/cobc/ChangeLog +++ b/cobc/ChangeLog @@ -1,4 +1,10 @@ +2025-01-06 Fabrice Le Fessant + + * parser.y (rule occurs_index): set index_type to CB_INT_INDEX + also for INDEXED BY appaering in LINKAGE SECTION, otherwise + the variable is not added to the local include file + 2025-01-03 Fabrice Le Fessant * typeck.c (build_evaluate, cb_check_needs_break): fix a bug where diff --git a/cobc/parser.y b/cobc/parser.y index 6293848c0..501bb2d65 100644 --- a/cobc/parser.y +++ b/cobc/parser.y @@ -8569,7 +8569,8 @@ occurs_index: const cb_tree init_val = cb_default_byte == CB_DEFAULT_BYTE_INIT ? cb_int1 : NULL; $$ = cb_build_index ($1, init_val, 1U, current_field); - if (storage == CB_STORAGE_LOCAL) { + if (storage == CB_STORAGE_LOCAL || + storage == CB_STORAGE_LINKAGE) { CB_FIELD_PTR ($$)->index_type = CB_INT_INDEX; } else { CB_FIELD_PTR ($$)->index_type = CB_STATIC_INT_INDEX; From c18eeb134e4be45c9380da875b755030eeeb3573 Mon Sep 17 00:00:00 2001 From: Emilien Lemaire Date: Thu, 23 Jan 2025 11:22:19 +0100 Subject: [PATCH 4/7] Update tests --- INSTALL | 477 +++++++++++---------- build_aux/ar-lib | 2 +- build_aux/compile | 11 +- build_aux/config.guess | 11 +- build_aux/config.rpath | 93 +--- build_aux/config.sub | 729 ++++++++------------------------ build_aux/depcomp | 17 +- build_aux/install-sh | 14 +- build_aux/ltmain.sh | 259 +++++++++--- build_aux/mdate-sh | 10 +- build_aux/missing | 77 ++-- build_aux/mkinstalldirs | 8 +- build_aux/ylwrap | 14 +- m4/gettext.m4 | 98 +++-- m4/iconv.m4 | 1 + m4/intlmacosx.m4 | 20 +- m4/lib-ld.m4 | 167 +++++--- m4/lib-link.m4 | 216 ++++++---- m4/lib-prefix.m4 | 264 ++++++++---- m4/libtool.m4 | 195 +++++++-- m4/ltsugar.m4 | 2 +- m4/ltversion.m4 | 10 +- m4/lt~obsolete.m4 | 4 +- m4/nls.m4 | 5 +- m4/po.m4 | 18 +- m4/progtest.m4 | 19 +- po/Makefile.in.in | 133 +++--- po/Rules-quot | 6 +- po/insert-header.sin | 5 - po/remove-potcdate.sin | 8 +- tests/testsuite.src/run_misc.at | 129 +++++- 31 files changed, 1563 insertions(+), 1459 deletions(-) mode change 100755 => 100644 build_aux/ltmain.sh diff --git a/INSTALL b/INSTALL index 8865734f8..d3b6e4ec4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,177 +1,177 @@ Installation Instructions ************************* - Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software -Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - Basic Installation ================== - Briefly, the shell command './configure && make && make install' -should configure, build, and install this package. The following -more-detailed instructions are generic; see the 'README' file for -instructions specific to this package. Some packages provide this -'INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The 'configure' shell script attempts to guess correct values for + The following shell commands: + + test -f configure || ./bootstrap + ./configure + make + make install + +should configure, build, and install this package. The first line, +which bootstraps, is intended for developers; when building from +distribution tarballs it does nothing and can be skipped. + + The following more-detailed instructions are generic; see the +‘README’ file for instructions specific to this package. Some packages +provide this ‘INSTALL’ file but do not implement all of the features +documented below. The lack of an optional feature in a given package is +not necessarily a bug. More recommendations for GNU packages can be +found in the GNU Coding Standards. + + Many packages have scripts meant for developers instead of ordinary +builders, as they may use developer tools that are less commonly +installed, or they may access the network, which has privacy +implications. If the ‘bootstrap’ shell script exists, it attempts to +build the ‘configure’ shell script and related files, possibly using +developer tools or the network. Because the output of ‘bootstrap’ is +system-independent, it is normally run by a package developer so that +its output can be put into the distribution tarball and ordinary +builders and users need not run ‘bootstrap’. Some packages have +commands like ‘./autopull.sh’ and ‘./autogen.sh’ that you can run +instead of ‘./bootstrap’, for more fine-grained control over +bootstrapping. + + The ‘configure’ shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses -those values to create a 'Makefile' in each directory of the package. -It may also create one or more '.h' files containing system-dependent -definitions. Finally, it creates a shell script 'config.status' that +those values to create a ‘Makefile’ in each directory of the package. +It may also create one or more ‘.h’ files containing system-dependent +definitions. Finally, it creates a shell script ‘config.status’ that you can run in the future to recreate the current configuration, and a -file 'config.log' containing compiler output (useful mainly for -debugging 'configure'). +file ‘config.log’ containing output useful for debugging ‘configure’. - It can also use an optional file (typically called 'config.cache' and -enabled with '--cache-file=config.cache' or simply '-C') that saves the + It can also use an optional file (typically called ‘config.cache’ and +enabled with ‘--cache-file=config.cache’ or simply ‘-C’) that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try -to figure out how 'configure' could check whether to do them, and mail -diffs or instructions to the address given in the 'README' so they can +to figure out how ‘configure’ could check whether to do them, and mail +diffs or instructions to the address given in the ‘README’ so they can be considered for the next release. If you are using the cache, and at -some point 'config.cache' contains results you don't want to keep, you +some point ‘config.cache’ contains results you don’t want to keep, you may remove or edit it. - The file 'configure.ac' (or 'configure.in') is used to create -'configure' by a program called 'autoconf'. You need 'configure.ac' if -you want to change it or regenerate 'configure' using a newer version of -'autoconf'. + The ‘autoconf’ program generates ‘configure’ from the file +‘configure.ac’. Normally you should edit ‘configure.ac’ instead of +editing ‘configure’ directly. The simplest way to compile this package is: - 1. 'cd' to the directory containing the package's source code and type - './configure' to configure the package for your system. + 1. ‘cd’ to the directory containing the package’s source code. + + 2. If this is a developer checkout and file ‘configure’ does not yet + exist, type ‘./bootstrap’ to create it. You may need special + developer tools and network access to bootstrap, and the network + access may have privacy implications. - Running 'configure' might take a while. While running, it prints - some messages telling which features it is checking for. + 3. Type ‘./configure’ to configure the package for your system. This + might take a while. While running, ‘configure’ prints messages + telling which features it is checking for. - 2. Type 'make' to compile the package. + 4. Type ‘make’ to compile the package. - 3. Optionally, type 'make check' to run any self-tests that come with + 5. Optionally, type ‘make check’ to run any self-tests that come with the package, generally using the just-built uninstalled binaries. - 4. Type 'make install' to install the programs and any data files and + 6. Type ‘make install’ to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular - user, and only the 'make install' phase executed with root + user, and only the ‘make install’ phase executed with root privileges. - 5. Optionally, type 'make installcheck' to repeat any self-tests, but + 7. Optionally, type ‘make installcheck’ to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a - regular user, particularly if the prior 'make install' required + regular user, particularly if the prior ‘make install’ required root privileges, verifies that the installation completed correctly. - 6. You can remove the program binaries and object files from the - source code directory by typing 'make clean'. To also remove the - files that 'configure' created (so you can compile the package for - a different kind of computer), type 'make distclean'. There is - also a 'make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type 'make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide 'make - distcheck', which can by used by developers to test that all other - targets like 'make install' and 'make uninstall' work correctly. - This target is generally not run by end users. + 8. You can remove the program binaries and object files from the + source code directory by typing ‘make clean’. To also remove the + files that ‘configure’ created (so you can compile the package for + a different kind of computer), type ‘make distclean’. There is + also a ‘make maintainer-clean’ target, but that is intended mainly + for the package’s developers. If you use it, you may have to + bootstrap again. + + 9. If the package follows the GNU Coding Standards, you can type ‘make + uninstall’ to remove the installed files. Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the 'configure' script does not know about. Run './configure --help' +the ‘configure’ script does not know about. Run ‘./configure --help’ for details on some of the pertinent environment variables. - You can give 'configure' initial values for configuration parameters + You can give ‘configure’ initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c99 CFLAGS=-g LIBS=-lposix + ./configure CC=gcc CFLAGS=-g LIBS=-lposix - *Note Defining Variables::, for more details. + See “Defining Variables” for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU 'make'. 'cd' to the -directory where you want the object files and executables to go and run -the 'configure' script. 'configure' automatically checks for the source -code in the directory that 'configure' is in and in '..'. This is known -as a "VPATH" build. - - With a non-GNU 'make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use 'make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple '-arch' options to the -compiler but only a single '-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the 'lipo' tool if you have problems. +same time, by placing the object files for each system in their own +directory. To do this, you can use GNU ‘make’. ‘cd’ to the directory +where you want the object files and executables to go and run the +‘configure’ script. ‘configure’ automatically checks for the source +code in the directory that ‘configure’ is in and in ‘..’. This is known +as a “VPATH” build. + + With a non-GNU ‘make’, it is safer to compile the package for one +system at a time in the source code directory. After you have installed +the package for one system, use ‘make distclean’ before reconfiguring +for another system. + + Some platforms, notably macOS, support “fat” or “universal” binaries, +where a single binary can execute on different architectures. On these +platforms you can configure and compile just once, with options specific +to that platform. Installation Names ================== - By default, 'make install' installs the package's commands under -'/usr/local/bin', include files under '/usr/local/include', etc. You -can specify an installation prefix other than '/usr/local' by giving -'configure' the option '--prefix=PREFIX', where PREFIX must be an + By default, ‘make install’ installs the package’s commands under +‘/usr/local/bin’, include files under ‘/usr/local/include’, etc. You +can specify an installation prefix other than ‘/usr/local’ by giving +‘configure’ the option ‘--prefix=PREFIX’, where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +pass the option ‘--exec-prefix=PREFIX’ to ‘configure’, the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like '--bindir=DIR' to specify different values for particular -kinds of files. Run 'configure --help' for a list of the directories +options like ‘--bindir=DIR’ to specify different values for particular +kinds of files. Run ‘configure --help’ for a list of the directories you can set and what kinds of files go in them. In general, the default -for these options is expressed in terms of '${prefix}', so that -specifying just '--prefix' will affect all of the other directory +for these options is expressed in terms of ‘${prefix}’, so that +specifying just ‘--prefix’ will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the -correct locations to 'configure'; however, many packages provide one or +correct locations to ‘configure’; however, many packages provide one or both of the following shortcuts of passing variable assignments to the -'make install' command line to change installation locations without +‘make install’ command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each -affected directory. For example, 'make install -prefix=/alternate/directory' will choose an alternate location for all +affected directory. For example, ‘make install +prefix=/alternate/directory’ will choose an alternate location for all directory configuration variables that were expressed in terms of -'${prefix}'. Any directories that were specified during 'configure', -but not in terms of '${prefix}', must each be overridden at install time +‘${prefix}’. Any directories that were specified during ‘configure’, +but not in terms of ‘${prefix}’, must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some @@ -179,190 +179,187 @@ platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. - The second method involves providing the 'DESTDIR' variable. For -example, 'make install DESTDIR=/alternate/directory' will prepend -'/alternate/directory' before all installation names. The approach of -'DESTDIR' overrides is not required by the GNU Coding Standards, and + The second method involves providing the ‘DESTDIR’ variable. For +example, ‘make install DESTDIR=/alternate/directory’ will prepend +‘/alternate/directory’ before all installation names. The approach of +‘DESTDIR’ overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of '${prefix}' -at 'configure' time. +when some directory options were not specified in terms of ‘${prefix}’ +at ‘configure’ time. Optional Features ================= If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving 'configure' the -option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. +with an extra prefix or suffix on their names by giving ‘configure’ the +option ‘--program-prefix=PREFIX’ or ‘--program-suffix=SUFFIX’. - Some packages pay attention to '--enable-FEATURE' options to -'configure', where FEATURE indicates an optional part of the package. -They may also pay attention to '--with-PACKAGE' options, where PACKAGE -is something like 'gnu-as' or 'x' (for the X Window System). The -'README' should mention any '--enable-' and '--with-' options that the -package recognizes. - - For packages that use the X Window System, 'configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the 'configure' options '--x-includes=DIR' and -'--x-libraries=DIR' to specify their locations. + Some packages pay attention to ‘--enable-FEATURE’ and +‘--disable-FEATURE’ options to ‘configure’, where FEATURE indicates an +optional part of the package. They may also pay attention to +‘--with-PACKAGE’ and ‘--without-PACKAGE’ options, where PACKAGE is +something like ‘gnu-ld’. ‘./configure --help’ should mention the +‘--enable-...’ and ‘--with-...’ options that the package recognizes. Some packages offer the ability to configure how verbose the -execution of 'make' will be. For these packages, running './configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with 'make V=1'; while running './configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with 'make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC -is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX 'make' updates targets which have the same time stamps as their -prerequisites, which makes it generally unusable when shipped generated -files such as 'configure' are involved. Use GNU 'make' instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its '' header file. The option '-nodtk' can be used as a -workaround. If GNU CC is not installed, it is therefore recommended to -try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put '/usr/ucb' early in your 'PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in '/usr/bin'. So, if you need '/usr/ucb' -in your 'PATH', put it _after_ '/usr/bin'. - - On Haiku, software installed for all users goes in '/boot/common', -not '/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features 'configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, 'configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -'--build=TYPE' option. TYPE can either be a short name for the system -type, such as 'sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file 'config.sub' for the possible values of each field. If -'config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option '--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with '--host=TYPE'. +execution of ‘make’ will be. For these packages, running ‘./configure +--enable-silent-rules’ sets the default to minimal output, which can be +overridden with ‘make V=1’; while running ‘./configure +--disable-silent-rules’ sets the default to verbose, which can be +overridden with ‘make V=0’. + +Specifying a System Type +======================== + + By default ‘configure’ builds for the current system. To create +binaries that can run on a different system type, specify a +‘--host=TYPE’ option along with compiler variables that specify how to +generate object code for TYPE. For example, to create binaries intended +to run on a 64-bit ARM processor: + + ./configure --host=aarch64-linux-gnu \ + CC=aarch64-linux-gnu-gcc \ + CXX=aarch64-linux-gnu-g++ + +If done on a machine that can execute these binaries (e.g., via +‘qemu-aarch64’, ‘$QEMU_LD_PREFIX’, and Linux’s ‘binfmt_misc’ +capability), the build behaves like a native build. Otherwise it is a +cross-build: ‘configure’ will make cross-compilation guesses instead of +running test programs, and ‘make check’ will not work. + + A system type can either be a short name like ‘mingw64’, or a +canonical name like ‘x86_64-pc-linux-gnu’. Canonical names have the +form CPU-COMPANY-SYSTEM where SYSTEM is either OS or KERNEL-OS. To +canonicalize and validate a system type, you can run the command +‘config.sub’, which is often squirreled away in a subdirectory like +‘build-aux’. For example: + + $ build-aux/config.sub arm64-linux + aarch64-unknown-linux-gnu + $ build-aux/config.sub riscv-lnx + Invalid configuration 'riscv-lnx': OS 'lnx' not recognized + +You can look at the ‘config.sub’ file to see which types are recognized. +If the file is absent, this package does not need the system type. + + If ‘configure’ fails with the diagnostic “cannot guess build type”. +‘config.sub’ did not recognize your system’s type. In this case, first +fetch the newest versions of these files from the GNU config package +(https://savannah.gnu.org/projects/config). If that fixes things, +please report it to the maintainers of the package containing +‘configure’. Otherwise, you can try the configure option ‘--build=TYPE’ +where TYPE comes close to your system type; also, please report the +problem to . + + For more details about configuring system types, see the Autoconf +documentation. Sharing Defaults ================ - If you want to set default values for 'configure' scripts to share, -you can create a site shell script called 'config.site' that gives -default values for variables like 'CC', 'cache_file', and 'prefix'. -'configure' looks for 'PREFIX/share/config.site' if it exists, then -'PREFIX/etc/config.site' if it exists. Or, you can set the -'CONFIG_SITE' environment variable to the location of the site script. -A warning: not all 'configure' scripts look for a site script. + If you want to set default values for ‘configure’ scripts to share, +you can create a site shell script called ‘config.site’ that gives +default values for variables like ‘CC’, ‘cache_file’, and ‘prefix’. +‘configure’ looks for ‘PREFIX/share/config.site’ if it exists, then +‘PREFIX/etc/config.site’ if it exists. Or, you can set the +‘CONFIG_SITE’ environment variable to the location of the site script. +A warning: not all ‘configure’ scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the -environment passed to 'configure'. However, some packages may run +environment passed to ‘configure’. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set -them in the 'configure' command line, using 'VAR=value'. For example: +them in the ‘configure’ command line, using ‘VAR=value’. For example: ./configure CC=/usr/local2/bin/gcc -causes the specified 'gcc' to be used as the C compiler (unless it is +causes the specified ‘gcc’ to be used as the C compiler (unless it is overridden in the site shell script). -Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Unfortunately, this technique does not work for ‘CONFIG_SHELL’ due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash -'configure' Invocation +‘configure’ Invocation ====================== - 'configure' recognizes the following options to control how it + ‘configure’ recognizes the following options to control how it operates. -'--help' -'-h' - Print a summary of all of the options to 'configure', and exit. +‘--help’ +‘-h’ + Print a summary of all of the options to ‘configure’, and exit. -'--help=short' -'--help=recursive' - Print a summary of the options unique to this package's - 'configure', and exit. The 'short' variant lists options used only - in the top level, while the 'recursive' variant lists options also +‘--help=short’ +‘--help=recursive’ + Print a summary of the options unique to this package’s + ‘configure’, and exit. The ‘short’ variant lists options used only + in the top level, while the ‘recursive’ variant lists options also present in any nested packages. -'--version' -'-V' - Print the version of Autoconf used to generate the 'configure' +‘--version’ +‘-V’ + Print the version of Autoconf used to generate the ‘configure’ script, and exit. -'--cache-file=FILE' +‘--cache-file=FILE’ Enable the cache: use and save the results of the tests in FILE, - traditionally 'config.cache'. FILE defaults to '/dev/null' to + traditionally ‘config.cache’. FILE defaults to ‘/dev/null’ to disable caching. -'--config-cache' -'-C' - Alias for '--cache-file=config.cache'. +‘--config-cache’ +‘-C’ + Alias for ‘--cache-file=config.cache’. -'--quiet' -'--silent' -'-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to '/dev/null' (any error - messages will still be shown). - -'--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - 'configure' can determine that directory automatically. +‘--srcdir=DIR’ + Look for the package’s source code in directory DIR. Usually + ‘configure’ can determine that directory automatically. -'--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: for +‘--prefix=DIR’ + Use DIR as the installation prefix. See “Installation Names” for more details, including other options available for fine-tuning the installation locations. -'--no-create' -'-n' +‘--host=TYPE’ + Build binaries for system TYPE. See “Specifying a System Type”. + +‘--enable-FEATURE’ +‘--disable-FEATURE’ + Enable or disable the optional FEATURE. See “Optional Features”. + +‘--with-PACKAGE’ +‘--without-PACKAGE’ + Use or omit PACKAGE when building. See “Optional Features”. + +‘--quiet’ +‘--silent’ +‘-q’ + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to ‘/dev/null’ (any error + messages will still be shown). + +‘--no-create’ +‘-n’ Run the configure checks, but stop before creating any output files. -'configure' also accepts some other, not widely useful, options. Run -'configure --help' for more details. +‘configure’ also recognizes several environment variables, and accepts +some other, less widely useful, options. Run ‘configure --help’ for +more details. + +Copyright notice +================ + + Copyright © 1994–1996, 1999–2002, 2004–2017, 2020–2024 Free Software +Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. diff --git a/build_aux/ar-lib b/build_aux/ar-lib index 7fbce26f0..152198749 100755 --- a/build_aux/ar-lib +++ b/build_aux/ar-lib @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2024-06-19.01; # UTC -# Copyright (C) 2010-2019,2024 Free Software Foundation, Inc. +# Copyright (C) 2010-2024 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff --git a/build_aux/compile b/build_aux/compile index 23fcba011..49b3d05fd 100755 --- a/build_aux/compile +++ b/build_aux/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2018-03-07.03; # UTC +scriptversion=2024-06-19.01; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2024 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -143,7 +143,7 @@ func_cl_wrapper () # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in - *.o | *.[oO][bB][jJ]) + *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift @@ -248,14 +248,17 @@ If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . +GNU Automake home page: . +General help using GNU software: . EOF exit $? ;; -v | --v*) - echo "compile $scriptversion" + echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; diff --git a/build_aux/config.guess b/build_aux/config.guess index 48a684601..f6d217a49 100755 --- a/build_aux/config.guess +++ b/build_aux/config.guess @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2024-07-27' +timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -123,7 +123,7 @@ set_cc_for_build() { dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c17 c99 c89 ; do + for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break @@ -634,8 +634,7 @@ EOF sed 's/^ //' << EOF > "$dummy.c" #include - int - main () + main() { if (!__power_pc()) exit(1); @@ -719,8 +718,7 @@ EOF #include #include - int - main () + int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -1623,7 +1621,6 @@ cat > "$dummy.c" <, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer @@ -17,81 +25,6 @@ # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. -# func_usage -# outputs to stdout the --help usage message. -func_usage () -{ - echo "\ -Usage: config.rpath [OPTION] HOST - -Prints shell variable assignments that describe how to hardcode a directory -for the lookup of shared libraries into a binary (executable or shared library). - -The first argument passed to this file is the canonical host specification, - CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -or - CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM - -The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld -should be set by the caller. - -The set of defined variables is at the end of this script. - -Options: - --help print this help and exit - --version print version information and exit - -Send patches and bug reports to ." -} - -# func_version -# outputs to stdout the --version message. -func_version () -{ - echo "config.rpath (GNU gnulib, module havelib)" - echo "Copyright (C) 2024 Free Software Foundation, Inc. -License: All-Permissive. -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law." - echo - printf 'Written by %s.\n' "Bruno Haible" -} - -# func_fatal_error message -# outputs to stderr a fatal error message, and terminates the program. -func_fatal_error () -{ - echo "config.rpath: *** $1" 1>&2 - echo "config.rpath: *** Stop." 1>&2 - exit 1 -} - -# Command-line option processing. -while test $# -gt 0; do - case "$1" in - --help | --hel | --he | --h ) - func_usage - exit 0 ;; - --version | --versio | --versi | --vers | --ver | --ve | --v ) - func_version - exit 0 ;; - -- ) # Stop option processing - shift; break ;; - -* ) - func_fatal_error "unrecognized option: $1" - ;; - * ) - break ;; - esac -done - -if test $# -gt 1; then - func_fatal_error "too many arguments" -fi -if test $# -lt 1; then - func_fatal_error "too few arguments" -fi - # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a @@ -438,7 +371,7 @@ else hardcode_direct=yes hardcode_minus_L=yes ;; - freebsd* | dragonfly* | midnightbsd*) + freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; @@ -614,7 +547,7 @@ case "$host_os" in freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; - freebsd* | dragonfly* | midnightbsd*) + freebsd* | dragonfly*) library_names_spec='$libname$shrext' ;; gnu*) diff --git a/build_aux/config.sub b/build_aux/config.sub index 4aaae46f6..2c6a07ab3 100755 --- a/build_aux/config.sub +++ b/build_aux/config.sub @@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright 1992-2024 Free Software Foundation, Inc. -# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale +# shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2024-05-27' +timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -120,6 +120,7 @@ case $# in esac # Split fields of configuration type +# shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; - kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) + kfreebsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; @@ -2245,8 +1864,6 @@ case $kernel-$os-$obj in ;; os2-emx-) ;; - rtmk-nova-) - ;; *-eabi*- | *-gnueabi*-) ;; none--*) @@ -2273,7 +1890,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos* | *-solaris*) + *-sunos*) vendor=sun ;; *-cnk* | *-aix*) diff --git a/build_aux/depcomp b/build_aux/depcomp index 5ff3c6feb..1f0aa972c 100755 --- a/build_aux/depcomp +++ b/build_aux/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2017-09-16.17; # UTC +scriptversion=2024-06-19.01; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,11 +47,13 @@ Environment variables: libtool Whether libtool is used (yes/no). Report bugs to . +GNU Automake home page: . +General help using GNU software: . EOF exit $? ;; -v | --v*) - echo "depcomp $scriptversion" + echo "depcomp (GNU Automake) $scriptversion" exit $? ;; esac @@ -113,7 +115,6 @@ nl=' # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then @@ -128,7 +129,7 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" -# Avoid interferences from the environment. +# Avoid interference from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We @@ -198,8 +199,8 @@ gcc3) ;; gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. +## but also to in-use compilers like IBM xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: @@ -783,7 +784,7 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/build_aux/install-sh b/build_aux/install-sh index ec298b537..b1d7a6f67 100755 --- a/build_aux/install-sh +++ b/build_aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2020-11-14.01; # UTC +scriptversion=2024-06-19.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -124,9 +124,9 @@ it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. -Email bug reports to bug-automake@gnu.org. -Automake home page: https://www.gnu.org/software/automake/ -" +Report bugs to . +GNU Automake home page: . +General help using GNU software: ." while test $# -ne 0; do case $1 in @@ -170,7 +170,7 @@ while test $# -ne 0; do -T) is_target_a_directory=never;; - --version) echo "$0 $scriptversion"; exit $?;; + --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;; --) shift break;; @@ -345,7 +345,7 @@ do ' 0 # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directly in world-writable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && @@ -353,7 +353,7 @@ do exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. + # Check for POSIX incompatibility with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. diff --git a/build_aux/ltmain.sh b/build_aux/ltmain.sh old mode 100755 new mode 100644 index def0a431a..a7cbc61e0 --- a/build_aux/ltmain.sh +++ b/build_aux/ltmain.sh @@ -2,7 +2,7 @@ ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.5.3 +# libtool (GNU libtool) 2.5.4.1-baa1-dirty # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.5.3 -package_revision=2.5.3 +VERSION=2.5.4.1-baa1-dirty +package_revision=2.5.4.1 ## ------ ## @@ -589,7 +589,7 @@ func_require_term_colors () # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. + # usable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes @@ -739,7 +739,7 @@ eval 'func_dirname () # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. -# value retuned in "$func_basename_result" +# value returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () @@ -897,7 +897,7 @@ func_mkdir_p () # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. + # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done @@ -2215,7 +2215,30 @@ func_version () # End: # Set a version string. -scriptversion='(GNU libtool) 2.5.3' +scriptversion='(GNU libtool) 2.5.4.1-baa1-dirty' + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + year=`date +%Y` + + cat < +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Originally written by Gordon Matzigkeit, 1996 +(See AUTHORS for complete contributor listing) +EOF + + exit $? +} # func_echo ARG... @@ -2238,18 +2261,6 @@ func_echo () } -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () -{ - $debug_cmd - - $warning_func ${1+"$@"} -} - - ## ---------------- ## ## Options parsing. ## ## ---------------- ## @@ -2261,19 +2272,23 @@ usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information + --finish use operation '--mode=finish' + --mode=MODE use operation mode MODE + --no-finish don't update shared library cache + --no-quiet, --no-silent print default informational messages + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --reorder-cache=DIRS reorder shared library cache for preferred DIRS + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. @@ -2306,12 +2321,12 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.5.3 + version: $progname $scriptversion automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . +GNU libtool home page: . General help using GNU software: ." exit 0 } @@ -2502,8 +2517,11 @@ libtool_options_prep () opt_dry_run=false opt_help=false opt_mode= + opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false + opt_finishing=true + opt_warning= nonopt= preserve_args= @@ -2593,14 +2611,18 @@ libtool_parse_options () clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" + *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit - break ;; esac shift ;; + --no-finish) + opt_finishing=false + func_append preserve_args " $_G_opt" + ;; + --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" @@ -2616,6 +2638,24 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; + --reorder-cache) + opt_reorder_cache=true + shared_lib_dirs=$1 + if test -n "$shared_lib_dirs"; then + case $1 in + # Must begin with /: + /*) ;; + + # Catch anything else as an error (relative paths) + *) func_error "invalid argument '$1' for $_G_opt" + func_error "absolute paths are required for $_G_opt" + exit_cmd=exit + ;; + esac + fi + shift + ;; + --silent|--quiet) opt_quiet=: opt_verbose=false @@ -2652,6 +2692,18 @@ libtool_parse_options () func_add_hook func_parse_options libtool_parse_options +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + if $opt_warning; then + $debug_cmd + $warning_func ${1+"$@"} + fi +} + # libtool_validate_options [ARG]... # --------------------------------- @@ -3181,6 +3233,15 @@ func_convert_path_front_back_pathsep () # end func_convert_path_front_back_pathsep +# func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER +# Replaces a delimiter for a given path. +func_convert_delimited_path () +{ + converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` +} +# end func_convert_delimited_path + + ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## @@ -3515,6 +3576,65 @@ func_dll_def_p () } +# func_reorder_shared_lib_cache DIRS +# Reorder the shared library cache by unconfiguring previous shared library cache +# and configuring preferred search directories before previous search directories. +# Previous shared library cache: /usr/lib /usr/local/lib +# Preferred search directories: /tmp/testing +# Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib +func_reorder_shared_lib_cache () +{ + $debug_cmd + + case $host_os in + openbsd*) + get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` + func_convert_delimited_path "$get_search_directories" ':' '\ ' + save_search_directories=$converted_path + func_convert_delimited_path "$1" ':' '\ ' + + # Ensure directories exist + for dir in $converted_path; do + # Ensure each directory is an absolute path + case $dir in + /*) ;; + *) func_error "Directory '$dir' is not an absolute path" + exit $EXIT_FAILURE ;; + esac + # Ensure no trailing slashes + func_stripname '' '/' "$dir" + dir=$func_stripname_result + if test -d "$dir"; then + if test -n "$preferred_search_directories"; then + preferred_search_directories="$preferred_search_directories $dir" + else + preferred_search_directories=$dir + fi + else + func_error "Directory '$dir' does not exist" + exit $EXIT_FAILURE + fi + done + + PATH="$PATH:/sbin" ldconfig -U $save_search_directories + PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories + get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` + func_convert_delimited_path "$get_search_directories" ':' '\ ' + reordered_search_directories=$converted_path + + $ECHO "Original: $save_search_directories" + $ECHO "Reordered: $reordered_search_directories" + exit $EXIT_SUCCESS + ;; + *) + func_error "--reorder-cache is not supported for host_os=$host_os." + exit $EXIT_FAILURE + ;; + esac +} +# end func_reorder_shared_lib_cache + + # func_mode_compile arg... func_mode_compile () { @@ -4087,6 +4207,12 @@ if $opt_help; then fi +# If option '--reorder-cache', reorder the shared library cache and exit. +if $opt_reorder_cache; then + func_reorder_shared_lib_cache $shared_lib_dirs +fi + + # func_mode_execute arg... func_mode_execute () { @@ -4271,7 +4397,7 @@ func_mode_finish () fi fi - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -4296,6 +4422,12 @@ func_mode_finish () for libdir in $libdirs; do $ECHO " $libdir" done + if test "false" = "$opt_finishing"; then + echo + echo "NOTE: finish_cmds were not executed during testing, so you must" + echo "manually run ldconfig to add a given test directory, LIBDIR, to" + echo "the search path for generated executables." + fi echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" @@ -4532,8 +4664,15 @@ func_mode_install () func_append dir "$objdir" if test -n "$relink_command"; then + # Strip any trailing slash from the destination. + func_stripname '' '/' "$libdir" + destlibdir=$func_stripname_result + + func_stripname '' '/' "$destdir" + s_destdir=$func_stripname_result + # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -6782,6 +6921,7 @@ func_mode_link () finalize_command=$nonopt compile_rpath= + compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= @@ -7337,7 +7477,8 @@ func_mode_link () # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) + # -q