Paul Smith [Sat, 19 Oct 2013 19:39:15 +0000 (15:39 -0400)]
[SV 40240] Use configure info to build load test shared libs
* tests/config-flags.pm.in: A new file containing variable assignments
for the test suite; these variables are set by configure to contain
the values detected there for compilers, flags, etc.
* tests/run_make_tests.pl: Require the config-flags.pm file
* tests/scripts/features/load, tests/scripts/features/loadapi: Use the
configure-provided values when building the shared test library.
* configure.ac: Replace tests/config-flags.pm.in
* Makefile.am: Make sure tests/config-flags.pm is up to date
Paul Smith [Sat, 19 Oct 2013 16:21:09 +0000 (12:21 -0400)]
[SV 40254] Modify build.sh to work properly with Guile support.
* guile.c (guile_gmake_setup) [HAVE_GUILE]: Define a stub function
when Guile support is not enabled.
* main.c (main) [HAVE_GUILE]: Always invoke guile_gmake_setup().
* Makefile.am: Make guile.c standard, not optional.
* build.template: Add the Guile compiler and linker flags.
Eli Zaretskii [Fri, 18 Oct 2013 10:12:22 +0000 (13:12 +0300)]
Fix MinGW64 problem with non-compliant vsnprintf.
makeint.h (__USE_MINGW_ANSI_STDIO) [__MINGW64_VERSION_MAJOR]:
Define for MinGW64, to force it to use an ANSI-compliant
implementation of vsnprintf. Reported by Christian Boos
<cboos@edgewall.org>.
Eli Zaretskii [Fri, 18 Oct 2013 10:08:12 +0000 (13:08 +0300)]
Fix the MSVC build on MS-Windows.
output.c (vsnprintf) [_MSC_VER]: Define, instead of defining
snprintf, which isn't used. Reported by Christian Boos
<cboos@edgewall.org>.
NMakefile.template (OBJS): Add load.obj and posixfcn.obj.
($(OUTDIR)/pathstuff.obj): New dependency.
Suggested by Christian Boos <cboos@edgewall.org>.
Paul Smith [Sun, 13 Oct 2013 14:54:32 +0000 (10:54 -0400)]
Convert to auto-generated ChangeLog files.
Rename existing ChangeLog files so they won't be distributed.
Add targets to maintMakefile to generate ChangeLog from the Git
repository. This will require a version of gnulib be available.
Because ChangeLog is auto-generated, we have to switch our
automake mode to "foreign" or it will complain and fail.
Paul Smith [Sat, 5 Oct 2013 20:10:30 +0000 (16:10 -0400)]
Sanitize the registered function interface.
Expand the characters which are legal in a function name, and check
the name for validity. Create a type for the function pointer.
Convert the last argument from a boolean to flags, to allow for expansion.
Eli Zaretskii [Wed, 2 Oct 2013 16:39:53 +0000 (19:39 +0300)]
Fix $abspath on Cygwin when HAVE_DOS_PATHS is in effect.
function.c (IS_ABSOLUTE) [__CYGWIN__]: Special definition for Cygwin.
(abspath) [__CYGWIN__]: Reset root_len to 1 if the absolute file name
has the Posix /foo/bar form.
[HAVE_DOS_PATHS]: Use root_len instead of hard-coded 2.
Paul Smith [Sat, 21 Sep 2013 22:47:26 +0000 (18:47 -0400)]
Portability enhancements for Mac OSX.
Don't dup stdout into stderr in the test suite.
Don't rely on $port_type eq "UNIX" to mean case-preserving.
Check against the real output of ar when creating archives.
Paul Smith [Sat, 14 Sep 2013 05:04:04 +0000 (01:04 -0400)]
Support the -Orecurse option properly.
In this mode we still collect all the output from a given target and
dump it at once. However we don't treat recursive lines any differently
from non-recursive lines. Also we don't print enter/leave messages
after every dump. However we do ensure that we always print them once
to stdout, so the parent make will collect it properly.
Paul Smith [Thu, 12 Sep 2013 08:07:52 +0000 (04:07 -0400)]
Enhance the output sync mode.
Create a new file, output.c, and collect functions that generate output there.
We introduce a new global context specifying where output should go (to stdout
or to a sync file), and the lowest level output generator chooses where to
write output based on that context.
This allows us to set the context globally, and all operations that write
output (including functions like $(info ...) etc.) will use it.
Removed the "--trace=dir" capability. It was too confusing. If you have
directory tracking enabled then output sync will print the enter/leave message
for each synchronized block. If you don't want that, disable directory
tracking.
Paul Smith [Mon, 22 Jul 2013 06:19:13 +0000 (02:19 -0400)]
[Bug #39310] Parse simple pattern prereqs for globbing.
We tried to get some efficiency by avoiding a parse_file_seq() for simple
pattern prerequisites, but this also means no wildcard expansion was
happening, so add it back. Add regression tests for wildcards in target and
prerequisite lists.
Paul Smith [Sat, 29 Jun 2013 01:57:59 +0000 (21:57 -0400)]
Set O_APPEND mode for stdout/stderr and output-sync temporary files.
POSIX does not guarantee that writes will be atomic if a file is
opened for normal (non-append) output. That means if multiple processes
are writing to the same file, output could be lost. I can't think of
a real use-case where we would NOT want append for stdout/stderr, so
force it if we can.
Eli Zaretskii [Sat, 22 Jun 2013 13:16:56 +0000 (16:16 +0300)]
Fix a fatal error at startup on Windows due to non-ASCII characters in PATH.
main.c (find_and_set_default_shell): Don't use file_exists_p or
dir_file_exists_p, as those call readdir, which can fail if PATH
includes directories with non-ASCII characters, and that would
cause Make to fail at startup with confusing diagnostics. See
https://sourceforge.net/mailarchive/message.php?msg_id=30846737
for the details.
Paul Smith [Sat, 22 Jun 2013 04:22:08 +0000 (00:22 -0400)]
Create a character map to use for locating stop-points in strings.
In various places we were passing flags and characters to compare, then
using complex conditionals to see where to stop in string searches.
Performance numbers reveal that we were spending as much as 23% of our
processing time in these functions, most of it in the comparison lines.
Instead create a character map and use a single bitwise comparison to
determine if this is any one of the stop characters.
Paul Smith [Wed, 22 May 2013 06:14:19 +0000 (02:14 -0400)]
Make MFLAGS and MAKEFLAGS more reliable and predictable.
Ensure all simple flags are kept in the initial batch of flags.
Do not allow any flags with options in that batch.
If there are only non-simple flags ensure MAKEFLAGS begins with " ".
Don't let MFLAGS start with "- ".
Eli Zaretskii [Sat, 18 May 2013 11:03:26 +0000 (14:03 +0300)]
Fix MS-Windows build with Guile.
guile.c: Move inclusion of makeint.h before gnumake.h. This
order must be observed when building Make, because gnumake.h must
be included with GMK_BUILDING_MAKE defined, which makeint.h
already does. Otherwise, the linker will look for, and fail to
find, gmk_* functions in some external dynamic library.
Paul Smith [Fri, 17 May 2013 05:20:39 +0000 (01:20 -0400)]
Remove the dlopen() pointer from struct filedef.
This pointer is almost never needed, and it increases the size of the filedef
struct for all files (of which there are a huge number for large builds).
Instead keep a bit field marking whether the file is a loaded object and if so
call a new function to unload it. In load.c we keep a simple linked list of
loaded objects (of which there will be very few typically) and their dlopen()
pointers.
Paul Smith [Mon, 13 May 2013 08:29:35 +0000 (04:29 -0400)]
[Savannah #20501] Handle adding -r/-R to MAKEFLAGS in the makefile.
If -R is set in the makefile and not the command line, then go through all the
default variables and undefine them. If -r is set in the makefile and not in
the command line, then remove all .SUFFIX prefixes (unless the user set it)
and SUFFIX variable setting. In -p mode don't print builtins.
Paul Smith [Mon, 13 May 2013 06:48:04 +0000 (02:48 -0400)]
Add a new variable: GNUMAKEFLAGS
This allows you to write portable makefiles that set GNU make-specific command
line options in the environment or makefile: add them to GNUMAKEFLAGS instead
of MAKEFLAGS and they will be seen by GNU make but ignored by other
implementations of make.
Paul Smith [Mon, 13 May 2013 05:30:24 +0000 (01:30 -0400)]
Add new --trace[=MODE] flags, with --trace=dir
This mode replaces the previous heuristic setting enabled with -O, where we
would log directory enter/leave for each synchronized output. Now we only
do that if --trace=dir is given.