If a resource compiler is available, use it to add a UTF-8 resource
to the GNU Make executable on Windows. As a result, GNU Make will
use UTF-8 as its ANSI code page, enabling it to work with UTF-8
encoded Makefiles, understand UTF-8 paths passed to it, etc.
These build process changes apply to all 3 ways that GNU Make can
be built for Windows:
1) configure
2) Basic.mk
3) build_w32.bat
When building with Visual Studio the resource compiler should always
be available.
When building with GCC or TCC, it depends on the availability of
'windres'.
If a resource compiler is not available, don't fail the build but
just proceed without the UTF-8 resource, effectively ignoring this
feature.
The UTF-8 resource only has an effect when GNU Make is running on a
minimum target version of Windows Version 1903 (May 2019 Update).
When the built GNU Make is running on an earlier version of Windows,
the embedded UTF-8 resource has no effect.
Code page information is added to --version output to tell users what
code pages are being used by any combination of GNU Make build (with
or without the UTF-8 resource) and Windows version that GNU Make is
running on (earlier than 1903 or not).
* README.git: Fix a typo.
* configure.ac: Search for windres and set WINDRES / HAVE_WINDRES.
* Makefile.am: Add manifest and resource files to EXTRA_DIST and
add a windres invocation to build them.
* build_w32.bat: Add support to build resource files.
* src/main.c (print_version): Add codepage info to Windows output.
* src/w32/utf8.manifest: Add a windres manifest file.
* src/w32/utf8.rc: Add a windres resource file.
* Basic.mk.template: Add support for building resource files.
* mk/Windows32.mk: Support windres resource files.
* .gitignore: Ignore TCC output directories.
Avoid cross-contamination between test files by creating a new
working directory for each file, and setting it as the current
directory before starting the tests in that file.
Rename the test output as tNNN.{base,log,diff,mk} where NNN is
a test number starting with 001 for the first test. It is
slightly more annoying to find diff files since you can't use
autocomplete directly but it is simpler to match things.
Detect the source directory as the location of the test_driver.pl
script, so remove the separate -srcdir option.
* Makefile.am: Remove hacks to create symlinks when building
out-of-tree, and remove -srcdir option from run_make_tests.
* tests/test_driver.pl: Locate $srcpath based on __FILE__, then
compute $toppath as its parent. Set $scriptpath under $srcpath
and $workpath under the current directory. Toss $*_filename
and modify get_logfile() etc. to use the suffix directly. Add
a chdir() around the invocation of the test.
* tests/run_make_tests.pl: Throw out the -srcdir option and use
$srcpath set in test_driver.pl. The #WORK# helper is no longer
useful so remove it. Set #PWD# to the current working dir. Always
search the local directory and $srcpath for config-flags.pm.
Use $srcpath for finding the thelp.pl script.
* tests/scripts/features/vpath: Don't put things in work/ as it
is no longer a subdirectory.
* tests/scripts/features/vpathgpath: Ditto.
* tests/scripts/features/vpathplus: Ditto.
* tests/scripts/misc/general1: Ditto.
* tests/scripts/misc/general2: Ditto.
* tests/scripts/options/dash-k: Ditto.
* tests/scripts/options/symlinks: Use $testpath as the working
directory.
* tests/scripts/variables/GNUMAKEFLAGS: Use the test helper to
display env var values (grepping for GNUMAKEFLAGS finds extra things
now that it is our current working directory).
Create a new special variable, .WARNINGS, to allow per-makefile
control over warnings. The command line settings will override
this.
Move the handling of warning flags to a new file: src/warning.c.
Allow the decode to work with generic strings, and call it from
decode_switches().
* Makefile.am: Add new file src/warning.c.
* build_w32.bat: Ditto.
* builddos.bat: Ditto.
* po/POTFILES.in: Ditto.
* src/makeint.h: #define for the .WARNINGS variable name.
* src/warning.h: Add declarations for methods moved from main.c.
Rename the enum warning_state to warning_action.
* src/warning.c: New file. Move all warning encode/decode here
from main.c.
* src/main.c: Move methods into warning.c and call those methods
instead.
(main): Set .WARNINGS as a special variable.
* src/job.c (construct_command_argv): Rename to warning_action.
* src/read.c (tilde_expand): Ditto.
* src/variable.c (set_special_var): Update warnings when the
.WARNINGS special variable is set.
* tests/scripts/options/warn: Check invalid warning options.
* tests/scripts/variables/WARNINGS: Add tests for the .WARNINGS
special variable.
Replace the singleton --warn-undefined-variables with infrastructure
to manage multiple warnings: the --warn option can take an action
"ignore", "warn", or "error" (which will apply to all warnings), or
a specific warning type and an action for that type. Multiple
options can be provided and are consolidated.
* NEWS: Announce the new option.
* doc/make.1: Document in the man page.
* doc/make.texi (Warnings): Document in the user's manual.
* Makefile.am: Add new header warning.h.
* src/warning.h: Define enum for actions and warning types, and
macros to test whether they are set. Keep the default settings
separate so that we can correctly reconstruct MAKEFLAGS.
* src/makeint.h: Remove deprecated warn_undefined_variables_flag.
* src/main.c: Create global variables to hold warning settings.
(switches): Add a new switch for --warn.
(initialize_warnings): Set the default warning actions.
(main): Call initialize_warnings().
(encode_warning_state, decode_warning_state): Convert warning states
between strings and enums.
(encode_warning_name, decode_warning_name): Convert warning names
between strings and enums.
(decode_warn_flags): Convert a --warn option into enum values. If
deprecated warn_undefined_variables_flag is set convert it to --warn.
(decode_switches): Don't remove duplicates of --warn since order
matters. Call decode_warn_flags() to handle --warn.
(define_makeflags): Special-case handling of --warn options written
to MAKEFLAGS: write out the current settings.
* src/read.c (tilde_expand): Use new warning control macros.
* src/variable.c (warn_undefined): Ditto.
* src/job.c (construct_command_argv): Ditto.
* tests/scripts/options/warn: Rename from warn-undefined-variables
and add tests for --warn.
* tests/scripts/variables/MAKEFLAGS: Expect the new behavior.
Older versions of GNU tar parse the TAR_OPTIONS variable, but do not
accept the --sort option: remove it before creating the error report
tar files. Note we still require a modern GNU tar to create release
tar files. Reported by Dmitry Goncharov <dgoncharov@users.sf.net>
* Makefile.am (check-regression): Remove --sort from TAR_OPTIONS
There is a lot of specialized code for supporting AmigaOS and it has
not been maintained for a number of years. It's highly unlikely that
the latest versions even compile properly on AmigaOS anymore. After
requesting that someone step forward to own the maintenance of the
port in the GNU Make 4.4 release and getting no takers, I removed it.
* NEWS: Announce the removal.
* README.in: Remove README.Amiga reference.
* README.Amiga: Remove unused file.
* SCOPTIONS: Ditto.
* src/amiga.c: Ditto.
* src/amiga.h: Ditto.
* src/config.ami: Ditto.
* mk/Amiga.mk: Ditto.
* Makefile.am: Remove references to deleted files.
* Basic.mk.template: Ditto.
* maintMakefile: Ditto.
* src/commands.c: Remove ifdef'd Amiga code.
* src/default.c: Ditto.
* src/dir.c: Ditto.
* src/file.c: Ditto.
* src/function.c: Ditto.
* src/job.c: Ditto.
* src/job.h: Ditto.
* src/main.c: Ditto.
* src/os.h: Ditto.
* src/read.c: Ditto.
* src/remake.c: Ditto.
Original patches provided by Igor Todorovski <itodorov@ca.ibm.com>
Reworked by Paul Smith <psmith@gnu.org>.
Thanks to IBM for providing a test system.
* NEWS: Announce support.
* AUTHORS: Ditto.
* README.zOS: Provide details on building GNU Make on z/OS.
* build.sh (get_mk_var): z/OS sh has a strange bug which causes it to
generate extra lines of output: rework the function to print output
as we compute it instead of collecting it into a variable, which
works around this bug.
* src/makeint.h: Declare MK_OS_ZOS if we're building for z/OS.
* src/arscan.c: Don't include <ar.h> on z/OS.
* src/job.c: We can't change environ in ASCII mode on z/OS.
* src/main.c: Ditto. Also we can't use pselect() on z/OS.
* src/posixos.c: pselect() seems to hang on z/OS: don't use it.
* tests/run_make_tests.pl: Handle different exit codes on z/OS.
* tests/test_driver.pl: Preserve some special z/OS env.vars.
Add special checks to output comparisons when on z/OS.
* tests/scripts/features/archives: Don't validate names. Don't
try to compile empty files as IBM compilers complain.
* tests/scripts/features/shell_assignment: Fix octal value of #.
* tests/scripts/features/temp_stdin: Don't print "term".
* tests/scripts/functions/shell: Handle shell exit codes.
* tests/scripts/targets/ONESHELL: Ditto.
* tests/scripts/targets/POSIX: sh -x prints differently.
* tests/scripts/variables/SHELL: Ditto.
Put declarations for missing functions which we create in src/misc.c
into a file which is included by config.h via AH_BOTTOM(). This
ensures those prototypes are available, even in files added to
lib/... from gnulib.
* src/mkcustom.h: Add a new file with function declarations.
* configure.ac: Include src/mkcustom.h in config.h with AH_BOTTOM()
* Makefile.am: Add the header to the SRCS list.
* src/makeint.h: Remove content that we added to src/mkcustom.h.
* src/config.ami: Add #include "mkcustom.h" to specialized config.h.
* src/config.h-vms: Ditto.
* src/config.h.W32: Ditto.
* src/configh.dos: Ditto.
* README.in: Add a section on running regression tests.
* Makefile.am (check-regression): Capture the test run output, and
on failure collect configure and test results into a tar file.
The README templates were not useful since the replacement step
didn't have anything to replace: rename them.
Rather than creating template files for the config variants, create
mkconfig.h.in containg PACKAGE_* variables to be replaced, and have
config variant header files include it. Note on POSIX we don't use
this, and continue to generate a single config.h.in file.
Use config.status to convert the README.in and mkconfig.h.in files
during distribution creation.
Modify all users of VERSION to use PACKAGE_VERSION instead.
* configure.ac: Use GNU Make not GNU make as the package name.
* README.in: Use GNU Make not GNU make.
* README.git: Remove references to README.W32.template.
* .gitignore: Update for new behavior.
* Basic.mk.template: Remove unused posix_SOURCES and VERSION, and
references to unshipped mk/Posix.mk
* Makefile.am: Add src/mkconfig.h as an extra dist file.
* bootstrap.bat: Rewrite mkconfig.h.in to mkconfig.h
* maintMakefile: Remove obsolete template files; add mkconfig.h.in.
* prepare_vms.com: Rewrite mkconfig.h.in to mkconfig.h
* mk/VMS.mk: Fix incorrect header file prerequisite.
* src/mkconfig.h.in: New file containing PACKAGE variables.
* src/config.ami: Include mkconfig.h.
* src/config.h.W32: Ditto.
* src/configh.dos: Ditto.
* src/config.h-vms: Ditto.
* src/version.c: Use PACKAGE_VERSION not VERSION.
We can no longer pass our mondo-warnings options to the builds,
as these will impact all the code including gnulib code, and this
won't work. Also allow the caller to disable either the build.sh
or makefile invocation, for testing.
* Makefile.am: Allow the caller to reset the path to the make
binary to be tested. Remove c90 test: gnulib doesn't support it.
Introduce non-deterministic ordering into goal and prerequisite
traversal to help tease out inconsistent failures that may happen
when running in parallel build mode.
Introduce second order into each dependency chain:
1. Existing order is syntactic order reachable via 'dep->next'
2. New order is shuffled order stored as 'dep->shuf' in each 'dep'
When updating goals and prerequisites and '--shuffle' is provided,
use the shuffled order to walk the graph. When automatic variable
are set always use the syntactic order of parameters.
* Makefile.am: Add new src/shuffle.c and src/shuffle.h file.
* build_w32.bat: Ditto.
* builddos.bat: Ditto.
* makefile.com: Ditto.
* po/POTFILES.in: Ditto.
* doc/make.texi: Add documentation for --shuffle.
* doc/make.1: Ditto.
* src/dep.h (DEP): Add the shuf pointer.
* src/filedef.h (struct file): Add was_shuffled flag.
* src/main.c: (shuffle_mode): Global flag for the shuffle mode.
(usage): Add the --shuffle option.
(switches): Ditto.
(main): Set shuffle_mode based on the command line parameter.
Reshuffle prerequisites if requested.
* src/remake.c (update_goal_chain): Walk the shuffled list if enabled.
(update_file_1): Ditto.
* src/shuffle.h: Provide an interface for shuffling prerequisites.
* src/shuffle.c: Implement option parsing and prerequisite shuffling.
* tests/scripts/options/shuffle: Test shuffle option and modes.
Depending on how make was configured it may add duplicate
directories in the default include search path: avoid this.
(Tweaked by psmith@gnu.org)
* configure.ac: Set AM variable KNOWN_PREFIX if --prefix is known
* Makefile.am: Only set INCLUDEDIR if prefix is not known
* read.c [default_include_directories]: Only add INCLUDEDIR if set
* tests/thelp.pl: Rename from tests/jhelp.pl.
(op): Use names instead of options for the operations.
(op): Add new operations for sleep, mkdir, and rm.
(op): Enhance wait to time out
* tests/run_make_tests.pl: Add a new #HELPER# replacement
(subst_make_string): Use fully-qualified path to thelp.pl
* tests/scripts/features/parallelism: Update to use thelp.pl
and the new named operations. Use thelp.pl sleep instead of
system-specific sleep commands.
* tests/scripts/features/output-sync: Update to use thelp.pl
instead of complex shell scripts.
* Makefile.am: Distribute tests/thelp.pl instead of tests/jhelp.pl
* tests/config-flags.pm.W32: Create a predefined Windows file.
* Makefile.am (test_FILES): Add it to the distribution.
* build_w32.bat: Install tests/config-flags.pm if not existing.
* tests/run_make_tests.pl (get_config): Create new function.
* tests/scripts/features/archives: Call get_config() rather than
using %CONFIG_FLAGS directly.
* tests/scripts/features/load: Ditto.
* tests/scripts/features/loadapi: Ditto.
* tests/scripts/functions/wildcard: Ditto.
* build.sh: Rename from build.template. Get the list of objects
from the Makefile. Move configure-replaced variables ...
* build.cfg.in: to this new .in file.
* configure.ac: Remove special handling of build.sh.in and add
build.cfg as a generated file.
* Makefile.am (EXTRA_DIST): Remove build.sh.in and add build.sh
and build.cfg.in for build.sh.in.
* maintMakefile: Remove handling for build.template. Treat
build.sh as a source file, not a generated file.
* .gitignore: Ignore generated build.cfg file.
Move content from glob/* and config/* into standard GNU directory
locations lib/* and m4/*.
Install the gnulib bootstrap script and its configuration file, and
create a bootstrap.bat file for Windows. Update the README.git file
with new requirements and instructions for building from Git.
At this point we only install the alloca, getloadavg, and FDL modules
from gnulib. We keep our old glob/fnmatch implementation since the
gnulib versions require significant amounts of infrastructure which
doesn't exist on Windows yet. Further work is required here.
Due to a problem with gnulib's version of getloadavg, we need to bump
the minimum required version of automake to 1.16.1 unfortunately.
* README.git: Update instructions
* NEWS: Move developer news to a separate section
* configure.ac: Update for use with gnulib modules
* bootstrap: Bootstrap from Git workspace (import from gnulib)
* bootstrap.conf: Bootstrap configuration for GNU make
* bootstrap.bat: Bootstrap from Git workspace for Windows
* gl/modules/make-glob: Support our local fnmatch/glob implementation
* config/acinclude.m4: Move to m4/
* config/dospaths.m4: Move to m4/
* glob/fnmatch.c: Move to lib/
* glob/fnmatch.h.in: Move to lib/
* glob/glob.c: Move to lib/
* glob/glob.h.in: Move to lib/
* Makefile.am: Update for new directories
* build.template: Update for new directories
* build_w32.bat: Update for new directories
* builddos.bat: Update for new directories
* maintMakefile: Update for new directories
* makefile.com: Update for new directories
* mk/Amiga.mk: Update for new directories
* mk/Posix.mk.in: Update for new directories
* mk/VMS.mk: Update for new directories
* mk/Windows32.mk: Update for new directories
* mk/msdosdjgpp.mk: Update for new directories
* po/LINGUAS: One language per line (needed by gnulib)
* INSTALL: Remove (obtained from gnulib)
* src/alloca.c: Remove (obtained from gnulib)
* src/getloadavg.c: Remove (obtained from gnulib)
* po/Makevars: Remove (created by bootstrap)
* config/*: Remove leftover files
* glob/*: Remove leftover files
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
Over time the non-standard build and install systems (nmake files,
smake files, Visual Studio project files, etc.) have atrophied and
maintaining them is not worth the effort, for such a simple utility
as make. Remove all the non-standard build tool support and unify
OS-specific build rules under a basic set of (GNU make) makefiles.
Preserve the existing bootstrapping scripts (for POSIX, Windows,
and MS-DOS). Also the existing VMS build scripts are left unchanged:
I don't have enough experience with VMS to venture into this area.
Perhaps one of the VMS maintainers might like to determine whether
conversion would be appropriate.
Rather than create libraries for w32 and glob (non-POSIX), simply
link the object files directly to remove the complexity.
* NEWS: Update with user-facing notes.
* Makefile.am: Clean up to use the latest automake best practices.
Build Windows code directly from the root makefile to avoid recursion.
* README.Amiga, README.DOS.template, README.W32.template: Updated.
* INSTALL: Point readers at the README.git file.
* maintMakefile: Remove obsolete files. Create Basic.mk file.
* Basic.mk.template, mk/*.mk: Create basic GNU make-based makefiles.
* build_w32.bat: Copy Basic.mk to Makefile
* configure.ac: We no longer need AM_PROG_AR.
* dosbuild.bat: Rename to builddos.bat. Incorporate configure.bat.
* Makefile.DOS.template: Remove.
* NMakefile.template, w32/subproc/NMakefile: Remove.
* SMakefile.template, glob/SMakefile, glob/SCOPTIONS, make.lnk: Remove.
* configure.bat, glob/configure.bat: Remove.
* w32/Makefile.am: Remove.
* make_msvc_net2003.sln, make_msvc_net2003.vcproj: Remove.
* Makefile.am, configure.ac: Check for pselect() and sys/select.h.
* main.c (main): Block SIGCHLD if we have pselect() support.
* posixos.c (jobserver_acquire): If we support pselect() then use
it to query the jobserver pipe, while also listening for SIGCHLD.
Also pselect() supports a timeout so avoid alarm() calls.
This also includes fixing the most of the exit handling code for VMS.
Self tests:
Previously about 94 Tests in 36 categories fail.
Now about 45 tests in 22 categories fail.
Because some tests do not properly clean up, the number of tests that
fail can vary by one or two test cases between consecutive runs.
* Makefile.am: Add new VMS files.
* job.c: add prototype for vms_strsignal().
* job.c: (child_error): Remove VMS specific code as no longer needed.
* job.c: (reap_children): The VMS specific code was setting the
status to 0 instead of setting it to the proper exit status.
* job.h: Add vms_launch_status to struct child.
* main.c: (main): Use environment variables for options to use MCR
* instead of a foreign command, and to always use command files for
subprocesses.
For VMS use (set_program_name) routine which is common to ports of
other GNU packages to VMS to set the program name used internally.
Use (vms_putenv_symbol) to set up symbols to be visible in child
programs, including recursive make launched by execve()
Start of Bash shell detection code for VMS.
* makefile.com: Need nested_include=none for building on VMS search
lists. Add vms_progname, vms_exit, and vms_export_symbol.
* makefile.vms: Need nested_include=none for building on VMS search
lists. Add vms_progname, vms_exit, vms_export_symbol.
* makeint.h: Make sure non-standard "VMS" macro is defined. Add
prototypes for new VMS routines. Remove VMS-specific failure codes.
* vmsjobs.c: Add VMS POSIX exit code constants.
(_is_unixy_shell): Detect Bash shell.
(vms_strsignal): simulate strsignal() on VMS.
(vmsHandleChildTerm): fix to properly report failed LIB$SPAWN() exit
status codes. Remove code that duplicated code in job.c.
(child_execute_job): Export environment symbols before spawning a
child and restore afterward unless option to use command files for
subprocesses is set. Improve handling of UNIX null commands ":".
* vms_exit.c: Provides vms_exit() to detect if an exit code is UNIX
or VMS, and converts the UNIX code into a VMS exit code.
* vms_export_symbol.c: Routines to create DCL symbols that work like
shell aliases or exported shell symbols and clean them up on exit.
* vms_export_symbol_test.com: Unit test for vms_export_symbol.c
* vms_progname.c: New file: VMS specific replace for progname.c that
is used in some GNU projects.
* 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
* 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.
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.
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.
Provide a simple API for loaded objects to interact with GNU make. I still
won't guarantee that this API won't change but it's much closer to something
that's supported and provides easy-to-use interfaces with a public header
file.