mirror of
https://github.com/mirror/make.git
synced 2025-02-10 20:00:21 +08:00
If we're on a DOS/W32/OS2 system and we're not using a unixy shell, don't
follow POSIX backslash/newline conventions. Use a different method for testing the SHELL variable, which hopefully will work better on non-UNIX systems.
This commit is contained in:
parent
bf58e35105
commit
6636dc1d5c
@ -79,6 +79,13 @@
|
|||||||
* make_msvc_net2003.vcproj, make_msvc_net2003.sln: MSVC Project files.
|
* make_msvc_net2003.vcproj, make_msvc_net2003.sln: MSVC Project files.
|
||||||
* Makefile.am (EXTRA_DIST): Add MSVC Project files.
|
* Makefile.am (EXTRA_DIST): Add MSVC Project files.
|
||||||
|
|
||||||
|
2005-07-15 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* job.c (construct_command_argv_internal) [DOS,WINDOWS32,OS/2]: If
|
||||||
|
we don't have a POSIX shell, then revert to the old
|
||||||
|
backslash-newline behavior (where they are stripped).
|
||||||
|
Fixes bug #13665.
|
||||||
|
|
||||||
2005-07-08 Paul D. Smith <psmith@gnu.org>
|
2005-07-08 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* config.h.W32.template: Reorder to match the standard config.h,
|
* config.h.W32.template: Reorder to match the standard config.h,
|
||||||
|
30
job.c
30
job.c
@ -2408,8 +2408,15 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
|||||||
{
|
{
|
||||||
/* Backslash-newline is handled differently depending on what
|
/* Backslash-newline is handled differently depending on what
|
||||||
kind of string we're in: inside single-quoted strings you
|
kind of string we're in: inside single-quoted strings you
|
||||||
keep them; in double-quoted strings they disappear. */
|
keep them; in double-quoted strings they disappear.
|
||||||
if (instring == '"')
|
For DOS/Windows/OS2, if we don't have a POSIX shell,
|
||||||
|
we keep the pre-POSIX behavior of removing the
|
||||||
|
backslash-newline. */
|
||||||
|
if (instring == '"'
|
||||||
|
#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32)
|
||||||
|
|| !unixy_shell
|
||||||
|
#endif
|
||||||
|
)
|
||||||
++p;
|
++p;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2693,12 +2700,23 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
|||||||
}
|
}
|
||||||
else if (*p == '\\' && p[1] == '\n')
|
else if (*p == '\\' && p[1] == '\n')
|
||||||
{
|
{
|
||||||
/* POSIX says we keep the backslash-newline, but throw out the
|
/* POSIX says we keep the backslash-newline, but throw out
|
||||||
next char if it's a TAB. */
|
the next char if it's a TAB. If we don't have a POSIX
|
||||||
|
shell on DOS/Windows/OS2, mimic the pre-POSIX behavior
|
||||||
|
and remove the backslash/newline. */
|
||||||
|
#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32)
|
||||||
|
# define PRESERVE_BSNL unixy_shell
|
||||||
|
#else
|
||||||
|
# define PRESERVE_BSNL 1
|
||||||
|
#endif
|
||||||
|
if (PRESERVE_BSNL)
|
||||||
|
{
|
||||||
*(ap++) = '\\';
|
*(ap++) = '\\';
|
||||||
*(ap++) = *(p++);
|
*(ap++) = '\\';
|
||||||
*(ap++) = *p;
|
*(ap++) = '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
++p;
|
||||||
if (p[1] == '\t')
|
if (p[1] == '\t')
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2005-08-25 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* scripts/variables/SHELL: Use a /./ prefix instead of //: the
|
||||||
|
former works better with non-UNIX environments. Fixes Savannah
|
||||||
|
bug #14129.
|
||||||
|
|
||||||
2005-08-13 Boris Kolpackov <boris@kolpackov.net>
|
2005-08-13 Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
* scripts/functions/wildcard: Wrap calls to $(wildcard ) with
|
* scripts/functions/wildcard: Wrap calls to $(wildcard ) with
|
||||||
|
@ -19,23 +19,23 @@ run_make_test('all:;@echo "$(SHELL)"', '', $mshell);
|
|||||||
# According to POSIX, any value of SHELL set in the makefile should _NOT_ be
|
# According to POSIX, any value of SHELL set in the makefile should _NOT_ be
|
||||||
# exported to the subshell! I wanted to set SHELL to be $^X (perl) in the
|
# exported to the subshell! I wanted to set SHELL to be $^X (perl) in the
|
||||||
# makefile, but make runs $(SHELL) -c 'commandline' and that doesn't work at
|
# makefile, but make runs $(SHELL) -c 'commandline' and that doesn't work at
|
||||||
# all when $(SHELL) is perl :-/. So, we just add an extra initial / and hope
|
# all when $(SHELL) is perl :-/. So, we just add an extra initial /./ which
|
||||||
# for the best on non-UNIX platforms :-/.
|
# works well on UNIX and seems to work OK on at least some non-UNIX systems.
|
||||||
|
|
||||||
$extraENV{SHELL} = $mshell;
|
$extraENV{SHELL} = $mshell;
|
||||||
|
|
||||||
run_make_test("SHELL := /$mshell\n".'
|
run_make_test("SHELL := /./$mshell\n".'
|
||||||
all:;@echo "$(SHELL) $$SHELL"
|
all:;@echo "$(SHELL) $$SHELL"
|
||||||
', '', "/$mshell $mshell");
|
', '', "/./$mshell $mshell");
|
||||||
|
|
||||||
# As a GNU make extension, if make's SHELL variable is explicitly exported,
|
# As a GNU make extension, if make's SHELL variable is explicitly exported,
|
||||||
# then we really _DO_ export it.
|
# then we really _DO_ export it.
|
||||||
|
|
||||||
$extraENV{SHELL} = $mshell;
|
$extraENV{SHELL} = $mshell;
|
||||||
|
|
||||||
run_make_test("export SHELL := /$mshell\n".'
|
run_make_test("export SHELL := /./$mshell\n".'
|
||||||
all:;@echo "$(SHELL) $$SHELL"
|
all:;@echo "$(SHELL) $$SHELL"
|
||||||
', '', "/$mshell /$mshell");
|
', '', "/./$mshell /./$mshell");
|
||||||
|
|
||||||
|
|
||||||
# Test out setting of SHELL, both exported and not, as a target-specific
|
# Test out setting of SHELL, both exported and not, as a target-specific
|
||||||
@ -43,14 +43,14 @@ all:;@echo "$(SHELL) $$SHELL"
|
|||||||
|
|
||||||
$extraENV{SHELL} = $mshell;
|
$extraENV{SHELL} = $mshell;
|
||||||
|
|
||||||
run_make_test("all: SHELL := /$mshell\n".'
|
run_make_test("all: SHELL := /./$mshell\n".'
|
||||||
all:;@echo "$(SHELL) $$SHELL"
|
all:;@echo "$(SHELL) $$SHELL"
|
||||||
', '', "/$mshell $mshell");
|
', '', "/./$mshell $mshell");
|
||||||
|
|
||||||
$extraENV{SHELL} = $mshell;
|
$extraENV{SHELL} = $mshell;
|
||||||
|
|
||||||
run_make_test("all: export SHELL := /$mshell\n".'
|
run_make_test("all: export SHELL := /./$mshell\n".'
|
||||||
all:;@echo "$(SHELL) $$SHELL"
|
all:;@echo "$(SHELL) $$SHELL"
|
||||||
', '', "/$mshell $mshell");
|
', '', "/./$mshell $mshell");
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user