mirror of
https://github.com/mirror/make.git
synced 2026-08-20 08:53:28 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9c91ec34d | ||
|
|
f3a974bf32 | ||
|
|
c67266ceac | ||
|
|
4145bcbcda | ||
|
|
c637af71d9 | ||
|
|
a81013175c |
126
ChangeLog
126
ChangeLog
@@ -1,3 +1,128 @@
|
||||
2000-04-04 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.79 released.
|
||||
|
||||
* make.texinfo: Update documentation with new features for 3.79.
|
||||
|
||||
* function.c (func_wordlist): Don't re-order arguments to
|
||||
wordlist.
|
||||
|
||||
2000-04-03 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (f_mtime): Archive member timestamps are stored as
|
||||
time_t, without nanoseconds. But, f_mtime() wants to return
|
||||
nanosecond info on those systems that support it. So, convert the
|
||||
return value of ar_member_date() into a FILE_TIMESTAMP, using 0 as
|
||||
the nanoseconds.
|
||||
|
||||
2000-03-28 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.78.92 released.
|
||||
|
||||
* build.template: Updates for gettext support; some bugs fixed.
|
||||
|
||||
2000-03-27 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* config.guess, config.sub: Updated from config CVS archive at
|
||||
:pserver:anoncvs@subversions.gnu.org:/home/cvs as of today.
|
||||
|
||||
* read.c (record_files): Check if expanding a static pattern
|
||||
rule's prerequisite pattern leaves an empty string as the
|
||||
prerequisite, and issue an error if so. Fixes PR/1670.
|
||||
(read_makefile): Store the starting linenumber for a rule in
|
||||
TGTS_STARTED.
|
||||
(record_waiting_files): Use the TGTS_STARTED value for the file
|
||||
location passed to record_file() instead of the current
|
||||
linenumber, so error messages list the line where the target was
|
||||
defined instead of the line after the end of the rule definition.
|
||||
|
||||
* remake.c (start_updating, finish_updating, is_updating): Fix
|
||||
PR/1671; circular dependencies in double-colon rules are not
|
||||
diagnosed. These macros set the updating flag in the root
|
||||
double-colon file instead of the current one, if it's part of a
|
||||
double-colon list. This solution provided by Tim Magill
|
||||
<magill@gate.net>; I just changed the macro names :).
|
||||
(update_file_1): Call them.
|
||||
(check_dep): Call them.
|
||||
|
||||
The change to not automatically evaluate the $(call ...)
|
||||
function's arguments breaks recursive use of call. Although using
|
||||
$(if ...) and $(foreach ...) in $(call ...) macros is important,
|
||||
the error conditions generated are simply to obscure for me to
|
||||
feel comfortable with. If a method is devised to get both
|
||||
working, we'll revisit. For now, remove this change.
|
||||
|
||||
* function.c (function_table): Turn on the expand bit for func_call.
|
||||
(func_call): Don't expand arguments for builtin functions; that
|
||||
will have already been done.
|
||||
|
||||
2000-03-26 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* file.c (remove_intermediates): Never remove targets explicitly
|
||||
requested on the command-line by checking the cmd_target flag.
|
||||
Fixed PR/1669.
|
||||
|
||||
2000-03-23 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Use st_mtime instead of
|
||||
st_mtim.tv_sec; the latter doesn't work on Unixware.
|
||||
|
||||
2000-03-18 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* file.c (file_hash_enter): If we're trying to change a file into
|
||||
itself, just return. We used to assert this wasn't true, but
|
||||
someone came up with a weird case involving archives. After
|
||||
playing with it for a while I decided it was OK to ignore it.
|
||||
|
||||
* default.c: Define COFLAGS to empty to avoid spurious warnings.
|
||||
|
||||
* filedef.h: Change #if ST_MTIM_NSEC to #ifdef; this is a macro
|
||||
containing the name of the nsec field, not true/false.
|
||||
* make.h: Ditto.
|
||||
Reported by Marco Franzen <Marco.Franzen@Thyron.com>.
|
||||
|
||||
2000-03-08 Tim Magill <magill@gate.net>
|
||||
|
||||
* remake.c (update_file): Return the exit status of the pruned
|
||||
file when pruning, not just 0. Fixes PR/1634.
|
||||
|
||||
2000-02-24 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* configure.in: Close a minor potential security hole; if you're
|
||||
reading makefiles from stdin (who does that?) you could run into a
|
||||
race condition with the temp file using mktemp() or tmpnam(). Add
|
||||
a check for mkstemp() and fdopen().
|
||||
* main.c (open_tmpfile): New function to open a temporary file.
|
||||
If we have mkstemp() (and fdopen()), use that. If not use
|
||||
mktemp() or tmpnam(). If we have fdopen(), use open() to open the
|
||||
file O_CREAT|O_EXCL. If not, fall back to normal fopen() (insecure).
|
||||
(main): Call it.
|
||||
* job.c (child_execute_job) [VMS]: Call it.
|
||||
|
||||
* variable.c (lookup_variable): If we find a variable which is
|
||||
being expanded, then note it but keep looking through the rest of
|
||||
the set list to see if we can find one that isn't. If we do,
|
||||
return that. If we don't, return the original. Fix for PR/1610.
|
||||
|
||||
While implementing this I realized that it also solves PR/1380 in
|
||||
a much more elegant way. I don't know what I was smoking before.
|
||||
So, remove the hackage surrounding the original fix for that (see
|
||||
below). Change this function back to lookup_variable and remove
|
||||
the extra setlist argument.
|
||||
* variable.h (recursively_expand_setlist): Remove the macro,
|
||||
rename the prototype, and remove the extra setlist argument.
|
||||
(lookup_variable): Ditto.
|
||||
* expand.c (recursively_expand): Rename and remove the extra
|
||||
setlist argument.
|
||||
(reference_variable): Use lookup_variable() again.
|
||||
(allocated_variable_append): Remove the extra setlist argument.
|
||||
|
||||
2000-02-21 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* README.template: A few updates.
|
||||
|
||||
* i18n/de.po: New version from the German translation team.
|
||||
|
||||
2000-02-09 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.78.91 released.
|
||||
@@ -17,6 +142,7 @@
|
||||
implementing expansion of these references separately from the
|
||||
"normal" expansion, say, instead of using the same codepath.
|
||||
Actually, it's already "worse enough" :-/.
|
||||
Fix for PR/1380.
|
||||
|
||||
* variable.h (recursively_expand_setlist): Rename
|
||||
recursively_expand to add a struct variable_set_list argument, and
|
||||
|
||||
16
NEWS
16
NEWS
@@ -1,6 +1,6 @@
|
||||
GNU make NEWS -*-indented-text-*-
|
||||
History of user-visible changes.
|
||||
25 Jan 2000
|
||||
27 Mar 2000
|
||||
|
||||
Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
@@ -36,17 +36,11 @@ Version 3.79
|
||||
current makefile is run serially regardless of the value of -j.
|
||||
However, submakes are still eligible for parallel execution.
|
||||
|
||||
* The $(call ...) function doesn't expand its arguments automatically
|
||||
anymore. This allows you to put builtin functions like "if" and
|
||||
"foreach", which also have special expansion rules, in a $(call ...)
|
||||
function and have it work properly. This was suggested by Damien
|
||||
GIBOU <damien.gibou@st.com>.
|
||||
|
||||
* The --debug option has changed: it now allows optional flags
|
||||
controlling the amount and type of debugging output. By default only
|
||||
a minimal amount information is generated, displaying the names of
|
||||
"normal" targets (not makefiles) were deemed out of date and in need
|
||||
of being rebuilt.
|
||||
"normal" targets (not makefiles) that were deemed out of date and in
|
||||
need of being rebuilt.
|
||||
|
||||
Note that the -d option behaves as before: it takes no arguments and
|
||||
all debugging information is generated.
|
||||
@@ -54,6 +48,10 @@ Version 3.79
|
||||
* The `-p' (print database) output now includes filename and linenumber
|
||||
information for variable definitions, to help debugging.
|
||||
|
||||
* The wordlist function no longer reverses its arguments if the "start"
|
||||
value is greater than the "end" value. If that's true, nothing is
|
||||
returned.
|
||||
|
||||
* Hartmut Becker provided many updates for the VMS port of GNU make.
|
||||
See the readme.vms file for more details.
|
||||
|
||||
|
||||
@@ -19,6 +19,13 @@ Some systems' Make programs are broken and cannot process the Makefile for
|
||||
GNU Make. If you get errors from your system's Make when building GNU
|
||||
Make, try using `build.sh' instead.
|
||||
|
||||
|
||||
GNU Make is free software. See the file COPYING for copying conditions.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
GNU make is fully documented in the GNU Make manual, which is contained
|
||||
in this distribution as the file make.texinfo. You can also find
|
||||
on-line and preformatted (PostScript and DVI) versions at the FSF's web
|
||||
@@ -30,6 +37,10 @@ site. There is information there about ordering hardcopy documentation.
|
||||
|
||||
You can also find the latest versions of GNU Make from there.
|
||||
|
||||
|
||||
Bug Reporting
|
||||
-------------
|
||||
|
||||
You can send GNU make bug reports to <bug-make@gnu.org>. Please see the
|
||||
section of the GNU make manual entitled `Problems and Bugs' for
|
||||
information on submitting useful and complete bug reports.
|
||||
@@ -49,17 +60,36 @@ If you need help using GNU make, try these forums:
|
||||
news:gnu.utils.help
|
||||
news:gnu.utils.bug
|
||||
|
||||
Also:
|
||||
|
||||
CVS Access
|
||||
----------
|
||||
|
||||
The GNU make source repository is available via anonymous CVS from the
|
||||
GNU Subversions CVS server; look here for details:
|
||||
|
||||
http://www.gnu.org/software/devel.html
|
||||
|
||||
Please note: you won't be able to build GNU make from CVS without
|
||||
installing appropriate maintainer's tools, such as automake, autoconf,
|
||||
GNU make, and GCC. There are no instructions on this included with the
|
||||
tree, so you must be familiar with the installation and use of these
|
||||
tools. We make no guarantees about the contents or quality of the
|
||||
latest code in the CVS repository: it is not unheard of for code that is
|
||||
known to be broken to be checked in. Use at your own risk.
|
||||
|
||||
|
||||
Ports
|
||||
-----
|
||||
|
||||
- See README.customs for details on integrating GNU make with the
|
||||
Customs distributed build environment from the Pmake distribution.
|
||||
|
||||
- See readme.vms for details about GNU Make on OpenVMS.
|
||||
|
||||
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
|
||||
|
||||
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||
|
||||
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
|
||||
|
||||
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
||||
using DJGPP tools.
|
||||
|
||||
@@ -67,8 +97,10 @@ Also:
|
||||
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
||||
information.
|
||||
|
||||
|
||||
GNU Make is free software. See the file COPYING for copying conditions.
|
||||
Please note there are two _separate_ ports of GNU make for Microsoft
|
||||
systems: a native Windows tool built with (for example) MSVC or Cygwin,
|
||||
and a DOS-based tool built with DJGPP. Please be sure you are looking
|
||||
at the right README!
|
||||
|
||||
|
||||
System-specific Notes
|
||||
|
||||
@@ -27,7 +27,6 @@ CC='@CC@'
|
||||
CFLAGS='@CFLAGS@'
|
||||
CPPFLAGS='@CPPFLAGS@'
|
||||
LDFLAGS='@LDFLAGS@'
|
||||
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
||||
ALLOCA='@ALLOCA@'
|
||||
LOADLIBES='@LIBS@'
|
||||
extras='@LIBOBJS@'
|
||||
@@ -37,12 +36,17 @@ GLOBLIB='@GLOBLIB@'
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix='@prefix@'
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix='@exec_prefix@'
|
||||
exec_prefix=`eval echo @exec_prefix@`
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir=${exec_prefix}/lib
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir=${prefix}/include
|
||||
|
||||
localedir=${prefix}/share/locale
|
||||
aliaspath=${localedir}:.
|
||||
|
||||
defines="-DALIASPATH=\"${aliaspath}\" -DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
|
||||
|
||||
# Exit as soon as any command fails.
|
||||
set -e
|
||||
|
||||
@@ -51,13 +55,14 @@ objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
||||
|
||||
if [ x"$GLOBLIB" != x ]; then
|
||||
objs="$objs %globobjs%"
|
||||
globinc=-I${srcdir}/glob
|
||||
fi
|
||||
|
||||
# Compile the source files into those objects.
|
||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||
echo compiling ${file}...
|
||||
$CC $defines $CPPFLAGS $CFLAGS \
|
||||
-c -I. -I${srcdir} ${srcdir}/$file
|
||||
-c -I. -I${srcdir} ${globinc} ${srcdir}/$file
|
||||
done
|
||||
|
||||
# The object files were actually all put in the current directory.
|
||||
|
||||
296
config.guess
vendored
296
config.guess
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
@@ -23,8 +23,7 @@
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
# Please send patches to <autoconf-patches@gnu.org>.
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
@@ -68,6 +67,43 @@ trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:NetBSD:*:*)
|
||||
# Netbsd (nbsd) targets should (where applicable) match one or
|
||||
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
||||
# switched to ELF, *-*-netbsd* would select the old
|
||||
# object file format. This provides both forward
|
||||
# compatibility and a consistent mechanism for selecting the
|
||||
# object file format.
|
||||
# Determine the machine/vendor (is the vendor relevant).
|
||||
case "${UNAME_MACHINE}" in
|
||||
amiga) machine=m68k-cbm ;;
|
||||
arm32) machine=arm-unknown ;;
|
||||
atari*) machine=m68k-atari ;;
|
||||
sun3*) machine=m68k-sun ;;
|
||||
mac68k) machine=m68k-apple ;;
|
||||
macppc) machine=powerpc-apple ;;
|
||||
hp3[0-9][05]) machine=m68k-hp ;;
|
||||
ibmrt|romp-ibm) machine=romp-ibm ;;
|
||||
*) machine=${UNAME_MACHINE}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format.
|
||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep __ELF__ >/dev/null
|
||||
then
|
||||
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
|
||||
# Return netbsd for either. FIX?
|
||||
os=netbsd
|
||||
else
|
||||
os=netbsdelf
|
||||
fi
|
||||
# The OS release
|
||||
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
|
||||
# contains redundant information, the shorter form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit 0 ;;
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
@@ -77,41 +113,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
cat <<EOF >$dummy.s
|
||||
.data
|
||||
\$Lformat:
|
||||
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
|
||||
|
||||
.text
|
||||
.globl main
|
||||
.align 4
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.frame \$30,16,\$26,0
|
||||
ldgp \$29,0(\$27)
|
||||
.prologue 1
|
||||
.long 0x47e03d80 # implver \$0
|
||||
lda \$2,-1
|
||||
.long 0x47e20c21 # amask \$2,\$1
|
||||
lda \$16,\$Lformat
|
||||
mov \$0,\$17
|
||||
not \$1,\$18
|
||||
jsr \$26,printf
|
||||
ldgp \$29,0(\$26)
|
||||
mov 0,\$16
|
||||
jsr \$26,exit
|
||||
.end main
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
case `./$dummy` in
|
||||
0-0)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
1-0)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
1-1)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
1-101)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
2-303)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
2-307)
|
||||
UNAME_MACHINE="alphaev67"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
@@ -129,9 +175,6 @@ EOF
|
||||
Amiga*:UNIX_System_V:4.0:*)
|
||||
echo m68k-cbm-sysv4
|
||||
exit 0;;
|
||||
amiga:NetBSD:*:*)
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -156,12 +199,12 @@ EOF
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:OS/390:*:*)
|
||||
echo i370-ibm-openedition
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
arm32:NetBSD:*:*)
|
||||
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
@@ -218,15 +261,12 @@ EOF
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:NetBSD:*:*)
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
# The situation for MiNT is a little confusing. The machine name
|
||||
# can be virtually everything (everything which is not
|
||||
# "atarist" or "atariste" at least should have a processor
|
||||
# "atarist" or "atariste" at least should have a processor
|
||||
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
|
||||
# to the lowercase version "mint" (or "freemint"). Finally
|
||||
# the system name "TOS" denotes a system which is actually not
|
||||
@@ -250,15 +290,9 @@ EOF
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -271,9 +305,6 @@ EOF
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
macppc:NetBSD:*:*)
|
||||
echo powerpc-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:Mach:*:*)
|
||||
echo mips-dec-mach_bsd4.3
|
||||
exit 0 ;;
|
||||
@@ -289,6 +320,7 @@ EOF
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __cplusplus
|
||||
#include <stdio.h> /* for printf() prototype */
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
@@ -328,15 +360,18 @@ EOF
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
|
||||
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
|
||||
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
|
||||
then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
|
||||
[ ${TARGET_BINARY_INTERFACE}x = x ]
|
||||
then
|
||||
echo m88k-dg-dgux${UNAME_RELEASE}
|
||||
else
|
||||
else
|
||||
echo m88k-dg-dguxbcs${UNAME_RELEASE}
|
||||
fi
|
||||
else
|
||||
echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
else echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
@@ -402,7 +437,7 @@ EOF
|
||||
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
|
||||
echo romp-ibm-bsd4.4
|
||||
exit 0 ;;
|
||||
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
|
||||
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
|
||||
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
|
||||
exit 0 ;; # report: romp-ibm BSD 4.3
|
||||
*:BOSX:*:*)
|
||||
@@ -453,7 +488,7 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
rm -f $dummy.c $dummy
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
@@ -547,10 +582,13 @@ EOF
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
exit 0 ;;
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*T3E:*:*:*)
|
||||
echo alpha-cray-unicosmk${UNAME_RELEASE}
|
||||
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*SV1:*:*:*)
|
||||
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
@@ -563,13 +601,10 @@ EOF
|
||||
F301:UNIX_System_V:*:*)
|
||||
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
|
||||
i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:BSD/OS:*:*)
|
||||
@@ -587,9 +622,6 @@ EOF
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
@@ -618,12 +650,6 @@ EOF
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# uname on the ARM produces all sorts of strangeness, and we need to
|
||||
# filter it out.
|
||||
case "$UNAME_MACHINE" in
|
||||
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
|
||||
arm* | sa110*) UNAME_MACHINE="arm" ;;
|
||||
esac
|
||||
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
@@ -636,12 +662,38 @@ EOF
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_emulations" in
|
||||
*ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
|
||||
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
|
||||
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
|
||||
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
*ia64)
|
||||
echo "${UNAME_MACHINE}-unknown-linux"
|
||||
exit 0
|
||||
;;
|
||||
i?86linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit 0
|
||||
;;
|
||||
i?86coff)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
|
||||
exit 0
|
||||
;;
|
||||
sparclinux)
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
|
||||
exit 0
|
||||
;;
|
||||
armlinux)
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
|
||||
exit 0
|
||||
;;
|
||||
elf32arm*)
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
|
||||
exit 0
|
||||
;;
|
||||
armelf_linux*)
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnu"
|
||||
exit 0
|
||||
;;
|
||||
m68klinux)
|
||||
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
|
||||
exit 0
|
||||
;;
|
||||
elf32ppc | elf32ppclinux)
|
||||
# Determine Lib Version
|
||||
cat >$dummy.c <<EOF
|
||||
@@ -669,49 +721,61 @@ EOF
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm -f $dummy.c $dummy
|
||||
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
|
||||
echo powerpc-unknown-linux-gnu${LIBC}
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
sed 's/^ //' <<EOF >$dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
cat <<EOF >$dummy.s
|
||||
.data
|
||||
\$Lformat:
|
||||
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
|
||||
|
||||
.text
|
||||
.globl main
|
||||
.align 4
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,16,\$26,0
|
||||
ldgp \$29,0(\$27)
|
||||
.prologue 1
|
||||
.long 0x47e03d80 # implver \$0
|
||||
lda \$2,-1
|
||||
.long 0x47e20c21 # amask \$2,\$1
|
||||
lda \$16,\$Lformat
|
||||
mov \$0,\$17
|
||||
not \$1,\$18
|
||||
jsr \$26,printf
|
||||
ldgp \$29,0(\$26)
|
||||
mov 0,\$16
|
||||
jsr \$26,exit
|
||||
.end main
|
||||
EOF
|
||||
LIBC=""
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
case `./$dummy` in
|
||||
0-0)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
1-0)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
1-1)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
1-101)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
2-303)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
2-307)
|
||||
UNAME_MACHINE="alphaev67"
|
||||
;;
|
||||
esac
|
||||
|
||||
objdump --private-headers $dummy | \
|
||||
@@ -725,6 +789,7 @@ EOF
|
||||
elif test "${UNAME_MACHINE}" = "mips" ; then
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef __cplusplus
|
||||
#include <stdio.h> /* for printf() prototype */
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
@@ -740,6 +805,8 @@ EOF
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
elif test "${UNAME_MACHINE}" = "s390"; then
|
||||
echo s390-ibm-linux && exit 0
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld)
|
||||
# or one that does not give us useful --help.
|
||||
@@ -761,6 +828,7 @@ EOF
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
#ifdef __cplusplus
|
||||
#include <stdio.h> /* for printf() prototype */
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
@@ -798,19 +866,21 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
||||
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:5:7*)
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
|
||||
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
|
||||
# Fixed at (any) Pentium or better
|
||||
UNAME_MACHINE=i586
|
||||
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
|
||||
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
@@ -830,7 +900,11 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*DOS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# Left here for compatibility:
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i386.
|
||||
echo i386-pc-msdosdjgpp
|
||||
@@ -944,6 +1018,24 @@ EOF
|
||||
*:Rhapsody:*:*)
|
||||
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Power*:Mac*OS:*:*)
|
||||
echo powerpc-apple-macos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Mac*OS:*:*)
|
||||
echo ${UNAME_MACHINE}-apple-macos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
if test "${UNAME_MACHINE}" = "x86pc"; then
|
||||
UNAME_MACHINE=pc
|
||||
fi
|
||||
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
|
||||
exit 0;;
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit 0 ;;
|
||||
NSR-W:NONSTOP_KERNEL:*:*)
|
||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
|
||||
72
config.sub
vendored
72
config.sub
vendored
@@ -1,6 +1,8 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
@@ -25,6 +27,9 @@
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
@@ -68,7 +73,7 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
linux-gnu*)
|
||||
nto-qnx* | linux-gnu*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@@ -169,18 +174,20 @@ case $basic_machine in
|
||||
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
| 580 | i960 | h8300 \
|
||||
| x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
|
||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
|
||||
| alphaev6[78] \
|
||||
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
|
||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr5000 | miprs64vr5000el | mcore \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
|
||||
| thumb | d10v)
|
||||
| thumb | d10v | fr30 | avr)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
@@ -201,8 +208,10 @@ case $basic_machine in
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||
| xmp-* | ymp-* \
|
||||
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
|
||||
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| alphaev6[78]-* \
|
||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||
| clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
@@ -210,9 +219,9 @@ case $basic_machine in
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||
| mipstx39-* | mipstx39el-* | mcore-* \
|
||||
| f301-* | armv*-* | t3e-* \
|
||||
| f301-* | armv*-* | s390-* | sv1-* | t3e-* \
|
||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@@ -430,7 +439,6 @@ case $basic_machine in
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[34567]86v32)
|
||||
@@ -511,6 +519,10 @@ case $basic_machine in
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
mmix*)
|
||||
basic_machine=mmix-knuth
|
||||
os=-mmixware
|
||||
;;
|
||||
monitor)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
@@ -519,6 +531,10 @@ case $basic_machine in
|
||||
basic_machine=i386-unknown
|
||||
os=-msdos
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
@@ -528,7 +544,7 @@ case $basic_machine in
|
||||
os=-netbsd
|
||||
;;
|
||||
netwinder)
|
||||
basic_machine=armv4l-corel
|
||||
basic_machine=armv4l-rebel
|
||||
os=-linux
|
||||
;;
|
||||
news | news700 | news800 | news900)
|
||||
@@ -579,6 +595,9 @@ case $basic_machine in
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
op50n-* | op60c-*)
|
||||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
@@ -723,6 +742,10 @@ case $basic_machine in
|
||||
sun386 | sun386i | roadrunner)
|
||||
basic_machine=i386-sun
|
||||
;;
|
||||
sv1)
|
||||
basic_machine=sv1-cray
|
||||
os=-unicos
|
||||
;;
|
||||
symmetry)
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
@@ -912,12 +935,24 @@ case $os in
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
|
||||
| -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
case $basic_machine in
|
||||
x86-* | i[34567]86-*)
|
||||
;;
|
||||
*)
|
||||
os=-nto$os
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-nto*)
|
||||
os=-nto-qnx
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
|
||||
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
||||
;;
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
@@ -931,6 +966,12 @@ case $os in
|
||||
-sunos6*)
|
||||
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
||||
;;
|
||||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-wince*)
|
||||
os=-wince
|
||||
;;
|
||||
-osfrose*)
|
||||
os=-osfrose
|
||||
;;
|
||||
@@ -955,6 +996,9 @@ case $os in
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
;;
|
||||
-nsk)
|
||||
os=-nsk
|
||||
;;
|
||||
# Preserve the version number of sinix5.
|
||||
-sinix5.*)
|
||||
os=`echo $os | sed -e 's|sinix|sysv|'`
|
||||
@@ -1017,7 +1061,7 @@ case $basic_machine in
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
arm*-corel)
|
||||
arm*-rebel)
|
||||
os=-linux
|
||||
;;
|
||||
arm*-semi)
|
||||
@@ -1191,7 +1235,7 @@ case $basic_machine in
|
||||
-genix*)
|
||||
vendor=ns
|
||||
;;
|
||||
-mvs*)
|
||||
-mvs* | -opened*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
|
||||
@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
|
||||
AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required.
|
||||
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
||||
|
||||
AM_INIT_AUTOMAKE(make, 3.78.91)
|
||||
AM_INIT_AUTOMAKE(make, 3.79)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Regular configure stuff
|
||||
@@ -60,7 +60,7 @@ AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||
# clock_gettime is in -lposix4 in Solaris 2.6.
|
||||
AC_CHECK_LIB(posix4, clock_gettime)
|
||||
|
||||
AC_CHECK_FUNCS(memmove strchr memcpy strdup psignal mktemp pstat_getdynamic \
|
||||
AC_CHECK_FUNCS(memmove strchr memcpy strdup psignal mkstemp mktemp fdopen \
|
||||
clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
|
||||
setlinebuf seteuid setegid setreuid setregid pipe \
|
||||
strerror strsignal)
|
||||
@@ -74,6 +74,7 @@ AC_FUNC_SETVBUF_REVERSED
|
||||
AC_FUNC_SELECT
|
||||
|
||||
AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG.
|
||||
AC_CHECK_FUNCS(pstat_getdynamic) dnl Supposedly in AC_FUNC_GETLOADAVG, but...?
|
||||
AC_FUNC_GETLOADAVG
|
||||
|
||||
# Check out the wait reality.
|
||||
|
||||
@@ -396,10 +396,10 @@ static char *default_variables[] =
|
||||
|
||||
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
|
||||
and to the empty string if $@ does exist. */
|
||||
"CHECKOUT,v",
|
||||
"+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
|
||||
|
||||
"CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
|
||||
"CO", "co",
|
||||
"COFLAGS", "",
|
||||
|
||||
"CPP", "$(CC) -E",
|
||||
#ifdef CRAY
|
||||
"CF77PPFLAGS", "-P",
|
||||
|
||||
23
expand.c
23
expand.c
@@ -91,13 +91,11 @@ initialize_variable_output ()
|
||||
|
||||
/* Recursively expand V. The returned string is malloc'd. */
|
||||
|
||||
static char *allocated_variable_append PARAMS ((struct variable *v,
|
||||
struct variable_set_list *l));
|
||||
static char *allocated_variable_append PARAMS ((struct variable *v));
|
||||
|
||||
char *
|
||||
recursively_expand_setlist (v, list)
|
||||
recursively_expand (v)
|
||||
register struct variable *v;
|
||||
struct variable_set_list *list;
|
||||
{
|
||||
char *value;
|
||||
|
||||
@@ -109,7 +107,7 @@ recursively_expand_setlist (v, list)
|
||||
|
||||
v->expanding = 1;
|
||||
if (v->append)
|
||||
value = allocated_variable_append (v, list);
|
||||
value = allocated_variable_append (v);
|
||||
else
|
||||
value = allocated_variable_expand (v->value);
|
||||
v->expanding = 0;
|
||||
@@ -144,10 +142,9 @@ reference_variable (o, name, length)
|
||||
unsigned int length;
|
||||
{
|
||||
register struct variable *v;
|
||||
struct variable_set_list *setlist;
|
||||
char *value;
|
||||
|
||||
v = lookup_variable_setlist (name, length, &setlist);
|
||||
v = lookup_variable (name, length);
|
||||
|
||||
if (v == 0)
|
||||
warn_undefined (name, length);
|
||||
@@ -155,7 +152,7 @@ reference_variable (o, name, length)
|
||||
if (v == 0 || *v->value == '\0')
|
||||
return o;
|
||||
|
||||
value = (v->recursive ? recursively_expand_setlist (v, setlist) : v->value);
|
||||
value = (v->recursive ? recursively_expand (v) : v->value);
|
||||
|
||||
o = variable_buffer_output (o, value, strlen (value));
|
||||
|
||||
@@ -472,9 +469,8 @@ variable_expand_for_file (line, file)
|
||||
context of the next variable set, then we append the expanded value. */
|
||||
|
||||
static char *
|
||||
allocated_variable_append (v, list)
|
||||
allocated_variable_append (v)
|
||||
struct variable *v;
|
||||
struct variable_set_list *list;
|
||||
{
|
||||
struct variable_set_list *save;
|
||||
int len = strlen (v->name);
|
||||
@@ -486,12 +482,9 @@ allocated_variable_append (v, list)
|
||||
|
||||
variable_buffer = 0;
|
||||
|
||||
if (!list)
|
||||
list = current_variable_set_list;
|
||||
|
||||
assert(list->next != 0);
|
||||
assert(current_variable_set_list->next != 0);
|
||||
save = current_variable_set_list;
|
||||
current_variable_set_list = list->next;
|
||||
current_variable_set_list = current_variable_set_list->next;
|
||||
|
||||
var[0] = '$';
|
||||
var[1] = '(';
|
||||
|
||||
13
file.c
13
file.c
@@ -58,8 +58,7 @@ lookup_file (name)
|
||||
register char *lname, *ln;
|
||||
#endif
|
||||
|
||||
if (*name == '\0')
|
||||
abort ();
|
||||
assert (*name != '\0');
|
||||
|
||||
/* This is also done in parse_file_seq, so this is redundant
|
||||
for names read from makefiles. It is here for names passed
|
||||
@@ -128,8 +127,7 @@ enter_file (name)
|
||||
char *lname, *ln;
|
||||
#endif
|
||||
|
||||
if (*name == '\0')
|
||||
abort ();
|
||||
assert (*name != '\0');
|
||||
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
lname = (char *)malloc (strlen (name) + 1);
|
||||
@@ -252,8 +250,9 @@ file_hash_enter (file, name, oldhash, oldname)
|
||||
if (strieq (oldfile->hname, name))
|
||||
break;
|
||||
|
||||
/* If the old file is the same as the new file, something's wrong. */
|
||||
assert (oldfile != file);
|
||||
/* If the old file is the same as the new file, never mind. */
|
||||
if (oldfile == file)
|
||||
return;
|
||||
|
||||
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
||||
{
|
||||
@@ -394,7 +393,7 @@ remove_intermediates (sig)
|
||||
for (i = 0; i < FILE_BUCKETS; ++i)
|
||||
for (f = files[i]; f != 0; f = f->next)
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary)
|
||||
&& !f->secondary && !f->cmd_target)
|
||||
{
|
||||
int status;
|
||||
if (f->update_status == -1)
|
||||
|
||||
@@ -117,9 +117,9 @@ extern void set_command_state PARAMS ((struct file *file, int state));
|
||||
extern void notice_finished_file PARAMS ((struct file *file));
|
||||
|
||||
|
||||
#if ST_MTIM_NSEC
|
||||
#ifdef ST_MTIM_NSEC
|
||||
# define FILE_TIMESTAMP_STAT_MODTIME(st) \
|
||||
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtim.tv_sec, \
|
||||
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtime, \
|
||||
(st).st_mtim.ST_MTIM_NSEC)
|
||||
# define FILE_TIMESTAMPS_PER_S \
|
||||
MIN ((FILE_TIMESTAMP) 1000000000, \
|
||||
|
||||
151
function.c
151
function.c
@@ -37,7 +37,7 @@ struct function_table_entry
|
||||
unsigned char minimum_args;
|
||||
unsigned char maximum_args;
|
||||
char expand_args;
|
||||
char *(*func_ptr) PARAMS((char *output, char **argv, const char*funcname));
|
||||
char *(*func_ptr) PARAMS ((char *output, char **argv, const char *fname));
|
||||
};
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ lookup_function (table, s)
|
||||
const struct function_table_entry *table;
|
||||
const char *s;
|
||||
{
|
||||
int len = strlen(s);
|
||||
int len = strlen (s);
|
||||
|
||||
for (; table->name != NULL; ++table)
|
||||
if (table->len <= len
|
||||
@@ -386,7 +386,7 @@ func_patsubst (o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_join(o, argv, funcname)
|
||||
func_join (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -429,7 +429,7 @@ func_join(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_origin(o, argv, funcname)
|
||||
func_origin (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -483,7 +483,7 @@ func_origin(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_notdir_suffix(o, argv, funcname)
|
||||
func_notdir_suffix (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -518,7 +518,7 @@ func_notdir_suffix(o, argv, funcname)
|
||||
}
|
||||
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||
/* Handle the case of "d:foo/bar". */
|
||||
else if (streq(funcname, "notdir") && p2[0] && p2[1] == ':')
|
||||
else if (streq (funcname, "notdir") && p2[0] && p2[1] == ':')
|
||||
{
|
||||
p = p2 + 2;
|
||||
o = variable_buffer_output (o, p, len - (p - p2));
|
||||
@@ -544,7 +544,7 @@ func_notdir_suffix(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_basename_dir(o, argv, funcname)
|
||||
func_basename_dir (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -603,7 +603,7 @@ func_basename_dir(o, argv, funcname)
|
||||
}
|
||||
|
||||
static char *
|
||||
func_addsuffix_addprefix(o, argv, funcname)
|
||||
func_addsuffix_addprefix (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -636,7 +636,7 @@ func_addsuffix_addprefix(o, argv, funcname)
|
||||
}
|
||||
|
||||
static char *
|
||||
func_subst(o, argv, funcname)
|
||||
func_subst (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -649,7 +649,7 @@ func_subst(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_firstword(o, argv, funcname)
|
||||
func_firstword (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -666,7 +666,7 @@ func_firstword(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_words(o, argv, funcname)
|
||||
func_words (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -724,7 +724,7 @@ check_numeric (s, message)
|
||||
|
||||
|
||||
static char *
|
||||
func_word(o, argv, funcname)
|
||||
func_word (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -758,45 +758,42 @@ func_wordlist (o, argv, funcname)
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
{
|
||||
int i=0;
|
||||
int j=0;
|
||||
int start, count;
|
||||
|
||||
/* Check the first argument. */
|
||||
/* Check the arguments. */
|
||||
check_numeric (argv[0],
|
||||
_("non-numeric first argument to `wordlist' function"));
|
||||
i =atoi(argv[0]);
|
||||
check_numeric (argv[1],
|
||||
_("non-numeric second argument to `wordlist' function"));
|
||||
|
||||
j = atoi(argv[1]);
|
||||
start = atoi (argv[0]);
|
||||
count = atoi (argv[1]) - start + 1;
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
char *p;
|
||||
char *end_p = argv[2];
|
||||
|
||||
{
|
||||
char *p;
|
||||
char *end_p = argv[2];
|
||||
/* Find the beginning of the "start"th word. */
|
||||
while (((p = find_next_token (&end_p, 0)) != 0) && --start)
|
||||
;
|
||||
|
||||
int start = (i < j) ? i : j;
|
||||
int count = j -i ;
|
||||
if (count < 0)
|
||||
count = - count;
|
||||
count ++;
|
||||
if (p)
|
||||
{
|
||||
/* Find the end of the "count"th word from start. */
|
||||
while (--count && (find_next_token (&end_p, 0) != 0))
|
||||
;
|
||||
|
||||
/* Return the stuff in the middle. */
|
||||
o = variable_buffer_output (o, p, end_p - p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
while (((p = find_next_token (&end_p, 0)) != 0) && --start)
|
||||
{}
|
||||
if (p)
|
||||
{
|
||||
while (--count && (find_next_token (&end_p, 0) != 0))
|
||||
{}
|
||||
o = variable_buffer_output (o, p, end_p - p);
|
||||
}
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
static char*
|
||||
func_findstring(o, argv, funcname)
|
||||
func_findstring (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -888,7 +885,7 @@ func_filter_filterout (o, argv, funcname)
|
||||
/* Chop ARGV[1] up into words and then run each pattern through. */
|
||||
while ((p = find_next_token (&word_iterator, &len)) != 0)
|
||||
{
|
||||
struct a_word *w = (struct a_word *)alloca(sizeof(struct a_word));
|
||||
struct a_word *w = (struct a_word *)alloca (sizeof (struct a_word));
|
||||
if (wordhead == 0)
|
||||
wordhead = w;
|
||||
else
|
||||
@@ -944,7 +941,7 @@ func_filter_filterout (o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_strip(o, argv, funcname)
|
||||
func_strip (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -992,18 +989,18 @@ func_error (o, argv, funcname)
|
||||
another special case where function arguments aren't broken up,
|
||||
just create a format string that puts them back together. */
|
||||
for (len=0, argvp=argv; *argvp != 0; ++argvp)
|
||||
len += strlen(*argvp) + 2;
|
||||
len += strlen (*argvp) + 2;
|
||||
|
||||
p = msg = alloca (len + 1);
|
||||
|
||||
for (argvp=argv; argvp[1] != 0; ++argvp)
|
||||
{
|
||||
strcpy(p, *argvp);
|
||||
p += strlen(*argvp);
|
||||
strcpy (p, *argvp);
|
||||
p += strlen (*argvp);
|
||||
*(p++) = ',';
|
||||
*(p++) = ' ';
|
||||
}
|
||||
strcpy(p, *argvp);
|
||||
strcpy (p, *argvp);
|
||||
|
||||
if (*funcname == 'e')
|
||||
fatal (reading_file, "%s", msg);
|
||||
@@ -1128,7 +1125,7 @@ func_if (o, argv, funcname)
|
||||
}
|
||||
|
||||
static char *
|
||||
func_wildcard(o, argv, funcname)
|
||||
func_wildcard (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -1197,11 +1194,11 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
|
||||
HANDLE hProcess;
|
||||
|
||||
|
||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
saAttr.nLength = sizeof (SECURITY_ATTRIBUTES);
|
||||
saAttr.bInheritHandle = TRUE;
|
||||
saAttr.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (DuplicateHandle(GetCurrentProcess(),
|
||||
if (DuplicateHandle (GetCurrentProcess(),
|
||||
GetStdHandle(STD_INPUT_HANDLE),
|
||||
GetCurrentProcess(),
|
||||
&hIn,
|
||||
@@ -1371,7 +1368,7 @@ func_shell (o, argv, funcname)
|
||||
/* For error messages. */
|
||||
if (reading_file != 0)
|
||||
{
|
||||
error_prefix = (char *) alloca (strlen(reading_file->filenm)+11+4);
|
||||
error_prefix = (char *) alloca (strlen (reading_file->filenm)+11+4);
|
||||
sprintf (error_prefix,
|
||||
"%s:%lu: ", reading_file->filenm, reading_file->lineno);
|
||||
}
|
||||
@@ -1470,8 +1467,8 @@ func_shell (o, argv, funcname)
|
||||
if (batch_filename) {
|
||||
DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"),
|
||||
batch_filename));
|
||||
remove(batch_filename);
|
||||
free(batch_filename);
|
||||
remove (batch_filename);
|
||||
free (batch_filename);
|
||||
}
|
||||
shell_function_pid = 0;
|
||||
|
||||
@@ -1536,7 +1533,10 @@ func_shell (char *o, char **argv, const char *funcname)
|
||||
if (command_argv == 0)
|
||||
return o;
|
||||
|
||||
|
||||
/* Note the mktemp() is a security hole, but this only runs on Amiga.
|
||||
Ideally we would use main.c:open_tmpfile(), but this uses a special
|
||||
Open(), not fopen(), and I'm not familiar enough with the code to mess
|
||||
with it. */
|
||||
strcpy (tmp_output, "t:MakeshXXXXXXXX");
|
||||
mktemp (tmp_output);
|
||||
child_stdout = Open (tmp_output, MODE_NEWFILE);
|
||||
@@ -1620,7 +1620,7 @@ func_not (char* o, char **argv, char *funcname)
|
||||
#endif
|
||||
|
||||
|
||||
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof(_s)-1)
|
||||
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1)
|
||||
|
||||
/* Lookup table for builtin functions.
|
||||
|
||||
@@ -1634,7 +1634,7 @@ func_not (char* o, char **argv, char *funcname)
|
||||
EXPAND_ARGS means that all arguments should be expanded before invocation.
|
||||
Functions that do namespace tricks (foreach) don't automatically expand. */
|
||||
|
||||
static char *func_call PARAMS((char *o, char **argv, const char *funcname));
|
||||
static char *func_call PARAMS ((char *o, char **argv, const char *funcname));
|
||||
|
||||
|
||||
static struct function_table_entry function_table[] =
|
||||
@@ -1662,7 +1662,7 @@ static struct function_table_entry function_table[] =
|
||||
{ STRING_SIZE_TUPLE("words"), 1, 1, 1, func_words},
|
||||
{ STRING_SIZE_TUPLE("origin"), 1, 1, 1, func_origin},
|
||||
{ STRING_SIZE_TUPLE("foreach"), 3, 3, 0, func_foreach},
|
||||
{ STRING_SIZE_TUPLE("call"), 1, 0, 0, func_call},
|
||||
{ STRING_SIZE_TUPLE("call"), 1, 0, 1, func_call},
|
||||
{ STRING_SIZE_TUPLE("error"), 1, 1, 1, func_error},
|
||||
{ STRING_SIZE_TUPLE("warning"), 1, 1, 1, func_error},
|
||||
{ STRING_SIZE_TUPLE("if"), 2, 3, 0, func_if},
|
||||
@@ -1748,7 +1748,7 @@ handle_function (op, stringp)
|
||||
*stringp = end;
|
||||
|
||||
/* Get some memory to store the arg pointers. */
|
||||
argvp = argv = (char **) alloca (sizeof(char *) * (nargs + 2));
|
||||
argvp = argv = (char **) alloca (sizeof (char *) * (nargs + 2));
|
||||
|
||||
/* Chop the string into arguments, then a nul. As soon as we hit
|
||||
MAXIMUM_ARGS (if it's >0) assume the rest of the string is part of the
|
||||
@@ -1824,60 +1824,38 @@ func_call (o, argv, funcname)
|
||||
int i;
|
||||
const struct function_table_entry *entry_p;
|
||||
|
||||
fname = expand_argument (argv[0], NULL);
|
||||
|
||||
/* There is no way to define a variable with a space in the name, so strip
|
||||
leading and trailing whitespace as a favor to the user. */
|
||||
cp = fname;
|
||||
while (*cp != '\0' && isspace ((unsigned char)*cp))
|
||||
++cp;
|
||||
argv[0] = cp;
|
||||
fname = argv[0];
|
||||
while (*fname != '\0' && isspace ((unsigned char)*fname))
|
||||
++fname;
|
||||
|
||||
cp += strlen(cp) - 1;
|
||||
while (cp > argv[0] && isspace ((unsigned char)*cp))
|
||||
cp = fname + strlen (fname) - 1;
|
||||
while (cp > fname && isspace ((unsigned char)*cp))
|
||||
--cp;
|
||||
cp[1] = '\0';
|
||||
|
||||
/* Calling nothing is a no-op */
|
||||
if (*argv[0] == '\0')
|
||||
{
|
||||
free (fname);
|
||||
return o;
|
||||
}
|
||||
if (*fname == '\0')
|
||||
return o;
|
||||
|
||||
/* Are we invoking a builtin function? */
|
||||
|
||||
entry_p = lookup_function (function_table, argv[0]);
|
||||
entry_p = lookup_function (function_table, fname);
|
||||
|
||||
if (entry_p)
|
||||
{
|
||||
char **av;
|
||||
|
||||
free (fname);
|
||||
|
||||
/* How many arguments do we have? */
|
||||
for (i=0; argv[i+1]; ++i)
|
||||
;
|
||||
|
||||
/* If we need to expand arguments, do it now. */
|
||||
if (entry_p->expand_args)
|
||||
for (av=argv+1; *av; ++av)
|
||||
*av = expand_argument (*av, NULL);
|
||||
|
||||
o = expand_builtin_function (o, i, argv+1, entry_p);
|
||||
|
||||
/* What we expanded we must free... */
|
||||
if (entry_p->expand_args)
|
||||
for (av=argv+1; *av; ++av)
|
||||
free (*av);
|
||||
|
||||
return o;
|
||||
return expand_builtin_function (o, i, argv+1, entry_p);
|
||||
}
|
||||
|
||||
/* Not a builtin, so the first argument is the name of a variable to be
|
||||
expanded and interpreted as a function. Create the variable
|
||||
reference. */
|
||||
flen = strlen (argv[0]);
|
||||
flen = strlen (fname);
|
||||
|
||||
body = alloca (flen + 4);
|
||||
body[0] = '$';
|
||||
@@ -1905,6 +1883,5 @@ func_call (o, argv, funcname)
|
||||
|
||||
pop_variable_scope ();
|
||||
|
||||
free (fname);
|
||||
return o + strlen(o);
|
||||
return o + strlen (o);
|
||||
}
|
||||
|
||||
3165
i18n/de.po
3165
i18n/de.po
File diff suppressed because it is too large
Load Diff
21
job.c
21
job.c
@@ -1795,7 +1795,7 @@ child_execute_job (argv, child)
|
||||
int status;
|
||||
char *cmd = alloca (strlen (argv) + 512), *p, *q;
|
||||
char ifile[256], ofile[256], efile[256];
|
||||
char comname[50];
|
||||
char *comname = 0;
|
||||
char procname[100];
|
||||
|
||||
/* Parse IO redirection. */
|
||||
@@ -1944,8 +1944,6 @@ child_execute_job (argv, child)
|
||||
is desired. Forcing commands with newlines into DCLs allows to
|
||||
store search lists on user mode logicals. */
|
||||
|
||||
comname[0] = '\0';
|
||||
|
||||
if (strlen (cmd) > MAXCMDLEN
|
||||
|| (have_redirection != 0)
|
||||
|| (have_newline != 0))
|
||||
@@ -1962,12 +1960,9 @@ child_execute_job (argv, child)
|
||||
return 0;
|
||||
}
|
||||
|
||||
strcpy (comname, "sys$scratch:CMDXXXXXX.COM");
|
||||
(void) mktemp (comname);
|
||||
|
||||
outfile = fopen (comname, "w");
|
||||
outfile = open_tmpfile (&comname, "sys$scratch:CMDXXXXXX.COM");
|
||||
if (outfile == 0)
|
||||
pfatal_with_name (comname);
|
||||
pfatal_with_name (_("fopen (temporary file)"));
|
||||
|
||||
if (ifile[0])
|
||||
{
|
||||
@@ -2150,7 +2145,7 @@ child_execute_job (argv, child)
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
if (comname[0] && !ISDB (DB_JOBS))
|
||||
if (comname && !ISDB (DB_JOBS))
|
||||
unlink (comname);
|
||||
|
||||
return (status & 1);
|
||||
@@ -2465,10 +2460,10 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
|
||||
|
||||
slow_flag = strcmp((s1 ? s1 : ""), (s2 ? s2 : ""));
|
||||
|
||||
if (s1);
|
||||
free(s1);
|
||||
if (s2);
|
||||
free(s2);
|
||||
if (s1)
|
||||
free (s1);
|
||||
if (s2)
|
||||
free (s2);
|
||||
}
|
||||
if (slow_flag)
|
||||
goto slow;
|
||||
|
||||
79
main.c
79
main.c
@@ -68,7 +68,6 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn));
|
||||
# endif
|
||||
extern double atof ();
|
||||
#endif
|
||||
extern char *mktemp ();
|
||||
|
||||
static void print_data_base PARAMS ((void));
|
||||
static void print_version PARAMS ((void));
|
||||
@@ -728,6 +727,51 @@ msdos_return_to_initial_directory ()
|
||||
}
|
||||
#endif
|
||||
|
||||
extern char *mktemp ();
|
||||
extern int mkstemp ();
|
||||
|
||||
FILE *
|
||||
open_tmpfile(name, template)
|
||||
char **name;
|
||||
const char *template;
|
||||
{
|
||||
int fd;
|
||||
|
||||
#if defined HAVE_MKSTEMP || defined HAVE_MKTEMP
|
||||
# define TEMPLATE_LEN strlen (template)
|
||||
#else
|
||||
# define TEMPLATE_LEN L_tmpnam
|
||||
#endif
|
||||
*name = xmalloc (TEMPLATE_LEN + 1);
|
||||
strcpy (*name, template);
|
||||
|
||||
#if defined HAVE_MKSTEMP && defined HAVE_FDOPEN
|
||||
/* It's safest to use mkstemp(), if we can. */
|
||||
fd = mkstemp (*name);
|
||||
if (fd == -1)
|
||||
return 0;
|
||||
return fdopen (fd, "w");
|
||||
#else
|
||||
# ifdef HAVE_MKTEMP
|
||||
(void) mktemp (*name);
|
||||
# else
|
||||
(void) tmpnam (*name);
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_FDOPEN
|
||||
/* Can't use mkstemp(), but guard against a race condition. */
|
||||
fd = open (*name, O_CREAT|O_EXCL|O_WRONLY, 0600);
|
||||
if (fd == -1)
|
||||
return 0;
|
||||
return fdopen (fd, "w");
|
||||
# else
|
||||
/* Not secure, but what can we do? */
|
||||
return fopen (*name, "w");
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifndef _AMIGA
|
||||
int
|
||||
main (argc, argv, envp)
|
||||
@@ -1212,24 +1256,16 @@ int main (int argc, char ** argv)
|
||||
into a temporary file and read from that. */
|
||||
FILE *outfile;
|
||||
|
||||
/* Make a unique filename. */
|
||||
#ifdef HAVE_MKTEMP
|
||||
|
||||
#ifdef VMS
|
||||
static char name[] = "sys$scratch:GmXXXXXX";
|
||||
#else
|
||||
static char name[] = "/tmp/GmXXXXXX";
|
||||
#endif
|
||||
(void) mktemp (name);
|
||||
#else
|
||||
static char name[L_tmpnam];
|
||||
(void) tmpnam (name);
|
||||
#endif
|
||||
|
||||
if (stdin_nm)
|
||||
fatal (NILF, _("Makefile from standard input specified twice."));
|
||||
|
||||
outfile = fopen (name, "w");
|
||||
#ifdef VMS
|
||||
# define TMP_TEMPLATE "sys$scratch:GmXXXXXX"
|
||||
#else
|
||||
# define TMP_TEMPLATE "/tmp/GmXXXXXX"
|
||||
#endif
|
||||
|
||||
outfile = open_tmpfile (&stdin_nm, TMP_TEMPLATE);
|
||||
if (outfile == 0)
|
||||
pfatal_with_name (_("fopen (temporary file)"));
|
||||
while (!feof (stdin))
|
||||
@@ -1243,16 +1279,9 @@ int main (int argc, char ** argv)
|
||||
|
||||
/* Replace the name that read_all_makefiles will
|
||||
see with the name of the temporary file. */
|
||||
{
|
||||
char *temp;
|
||||
/* SGI compiler requires alloca's result be assigned simply. */
|
||||
temp = (char *) alloca (sizeof (name));
|
||||
bcopy (name, temp, sizeof (name));
|
||||
makefiles->list[i] = temp;
|
||||
}
|
||||
makefiles->list[i] = xstrdup (stdin_nm);
|
||||
|
||||
/* Make sure the temporary file will not be remade. */
|
||||
stdin_nm = savestring (name, sizeof (name) -1);
|
||||
f = enter_file (stdin_nm);
|
||||
f->updated = 1;
|
||||
f->update_status = 0;
|
||||
@@ -2683,7 +2712,7 @@ die (status)
|
||||
print_version ();
|
||||
|
||||
/* Wait for children to die. */
|
||||
for (err = status != 0; job_slots_used > 0; err = 0)
|
||||
for (err = (status != 0); job_slots_used > 0; err = 0)
|
||||
reap_children (1, err);
|
||||
|
||||
/* Let the remote job module clean up its state. */
|
||||
|
||||
3
make.h
3
make.h
@@ -275,7 +275,7 @@ extern char *alloca ();
|
||||
# endif /* HAVE_ALLOCA_H. */
|
||||
#endif /* GCC. */
|
||||
|
||||
#if ST_MTIM_NSEC
|
||||
#ifdef ST_MTIM_NSEC
|
||||
# if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
@@ -407,6 +407,7 @@ extern int alpha_compare PARAMS ((const void *, const void *));
|
||||
extern void print_spaces PARAMS ((unsigned int));
|
||||
extern char *find_char_unquote PARAMS ((char *, char *, int));
|
||||
extern char *find_percent PARAMS ((char *));
|
||||
extern FILE *open_tmpfile PARAMS ((char **, const char *));
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
extern int ar_name PARAMS ((char *));
|
||||
|
||||
92
make.texinfo
92
make.texinfo
@@ -8,10 +8,10 @@
|
||||
@c FSF publishers: format makebook.texi instead of using this file directly.
|
||||
|
||||
@set RCSID $Id$
|
||||
@set EDITION 0.54
|
||||
@set VERSION 3.78.1
|
||||
@set UPDATED 09 September 1999
|
||||
@set UPDATE-MONTH September 1999
|
||||
@set EDITION 0.55
|
||||
@set VERSION 3.79
|
||||
@set UPDATED 04 April 2000
|
||||
@set UPDATE-MONTH April 2000
|
||||
@comment The ISBN number might need to change on next publication.
|
||||
@set ISBN 1-882114-80-9 @c CHANGE THIS BEFORE PRINTING AGAIN! --psmith 16jul98
|
||||
|
||||
@@ -37,7 +37,7 @@ and issues the commands to recompile them.
|
||||
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
||||
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
||||
|
||||
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99
|
||||
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99, 2000
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
@@ -73,7 +73,7 @@ by the Free Software Foundation.
|
||||
@author Richard M. Stallman and Roland McGrath
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98
|
||||
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99, 2000
|
||||
Free Software Foundation, Inc.
|
||||
@sp 2
|
||||
Published by the Free Software Foundation @*
|
||||
@@ -134,7 +134,7 @@ This manual describes @code{make} and contains the following chapters:@refill
|
||||
* Missing:: What GNU @code{make} lacks from other @code{make}s.
|
||||
* Makefile Conventions:: Conventions for makefiles in GNU programs.
|
||||
* Quick Reference:: A quick reference for experienced users.
|
||||
* Make Errors:: A list of common errors generated by @code{make}.
|
||||
* Error Messages:: A list of common errors generated by @code{make}.
|
||||
* Complex Makefile:: A real example of a straightforward,
|
||||
but nontrivial, makefile.
|
||||
* Concept Index:: Index of Concepts
|
||||
@@ -2479,7 +2479,7 @@ Sub-@code{make}}.
|
||||
If @code{.NOTPARALLEL} is mentioned as a target, then this invocation of
|
||||
@code{make} will be run serially, even if the @samp{-j} option is
|
||||
given. Any recursively invoked @code{make} command will still be run in
|
||||
parallel if its makefile doesn't contain this target. Any prerequisites
|
||||
parallel (unless its makefile contains this target). Any prerequisites
|
||||
on this target are ignored.
|
||||
@end table
|
||||
|
||||
@@ -5854,8 +5854,7 @@ ending with word @var{e} (inclusive). The legitimate values of @var{s}
|
||||
and @var{e} start from 1. If @var{s} is bigger than the number of words
|
||||
in @var{text}, the value is empty. If @var{e} is bigger than the number
|
||||
of words in @var{text}, words up to the end of @var{text} are returned.
|
||||
If @var{s} is greater than @var{e}, @code{make} swaps them for you. For
|
||||
example,
|
||||
If @var{s} is greater than @var{e}, nothing is returned. For example,
|
||||
|
||||
@example
|
||||
$(wordlist 2, 3, foo bar baz)
|
||||
@@ -6060,6 +6059,12 @@ If @var{variable} is the name of a builtin function, the builtin function
|
||||
is always invoked (even if a @code{make} variable by that name also
|
||||
exists).
|
||||
|
||||
The @code{call} function expands the @var{param} arguments before
|
||||
assigning them to temporary variables. This means that @var{variable}
|
||||
values containing references to builtin functions that have special
|
||||
expansion rules, like @code{foreach} or @code{if}, may not work as you
|
||||
expect.
|
||||
|
||||
Some examples may make this clearer.
|
||||
|
||||
This macro simply reverses its arguments:
|
||||
@@ -6067,12 +6072,11 @@ This macro simply reverses its arguments:
|
||||
@smallexample
|
||||
reverse = $(2) $(1)
|
||||
|
||||
foo = a b
|
||||
bar = $(call reverse,$(foo))
|
||||
foo = $(call reverse,a,b)
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
Here @var{bar} will contain @samp{b a}.
|
||||
Here @var{foo} will contain @samp{b a}.
|
||||
|
||||
This one is slightly more interesting: it defines a macro to search for
|
||||
the first instance of a program in @code{PATH}:
|
||||
@@ -6803,8 +6807,6 @@ This is typically used with recursive invocations of @code{make}
|
||||
|
||||
@item -d
|
||||
@cindex @code{-d}
|
||||
@itemx --debug
|
||||
@cindex @code{--debug}
|
||||
@c Extra blank line here makes the table look better.
|
||||
|
||||
Print debugging information in addition to normal processing. The
|
||||
@@ -6812,7 +6814,46 @@ debugging information says which files are being considered for
|
||||
remaking, which file-times are being compared and with what results,
|
||||
which files actually need to be remade, which implicit rules are
|
||||
considered and which are applied---everything interesting about how
|
||||
@code{make} decides what to do.
|
||||
@code{make} decides what to do. The @code{-d} option is equivalent to
|
||||
@samp{--debug=a} (see below).
|
||||
|
||||
@item --debug[=@var{options}]
|
||||
@cindex @code{--debug}
|
||||
@c Extra blank line here makes the table look better.
|
||||
|
||||
Print debugging information in addition to normal processing. Various
|
||||
levels and types of output can be chosen. With no arguments, print the
|
||||
``basic'' level of debugging. Possible arguments are below; only the
|
||||
first character is considered, and values must be comma- or
|
||||
space-separated.
|
||||
|
||||
@table @code
|
||||
@item a@var{ll}
|
||||
All types of debugging output is enabled. This is equivalent to using
|
||||
@samp{-d}.
|
||||
|
||||
@item b@var{asic}
|
||||
Basic debugging prints each target that was found to be out-of-date, and
|
||||
whether the build was successful or not.
|
||||
|
||||
@item v@var{erbose}
|
||||
A level above @samp{basic}; includes messages about which makefiles were
|
||||
parsed, prerequisites that did not need to be rebuilt, etc. This option
|
||||
also enables @samp{basic} messages.
|
||||
|
||||
@item i@var{mplicit}
|
||||
Prints messages describing the implicit rule searches for each target.
|
||||
This option also enables @samp{basic} messages.
|
||||
|
||||
@item j@var{obs}
|
||||
Prints messages giving details on the invocation of specific subcommands.
|
||||
|
||||
@item m@var{akefile}
|
||||
By default, the above messages are not enabled while trying to remake
|
||||
the makefiles. This option enables messages while rebuilding makefiles,
|
||||
too. Note that the @samp{all} option does enable this option. This
|
||||
option also enables @samp{basic} messages.
|
||||
@end table
|
||||
|
||||
@item -e
|
||||
@cindex @code{-e}
|
||||
@@ -6857,7 +6898,7 @@ searched in the order specified.
|
||||
|
||||
@item -j [@var{jobs}]
|
||||
@cindex @code{-j}
|
||||
@itemx --jobs=[@var{jobs}]
|
||||
@itemx --jobs[=@var{jobs}]
|
||||
@cindex @code{--jobs}
|
||||
Specifies the number of jobs (commands) to run simultaneously. With no
|
||||
argument, @code{make} runs as many jobs simultaneously as possible. If
|
||||
@@ -6920,7 +6961,9 @@ reading the makefiles; then execute as usual or as otherwise specified.
|
||||
This also prints the version information given by the @samp{-v} switch
|
||||
(see below). To print the data base without trying to remake any files,
|
||||
use @w{@samp{make -qp}}. To print the data base of predefined rules and
|
||||
variables, use @w{@samp{make -p -f /dev/null}}.
|
||||
variables, use @w{@samp{make -p -f /dev/null}}. The data base output
|
||||
contains filename and linenumber information for command and variable
|
||||
definitions, so it can be a useful debugging tool in complex environments.
|
||||
|
||||
@item -q
|
||||
@cindex @code{-q}
|
||||
@@ -9107,7 +9150,7 @@ special treatment.
|
||||
@comment included by standards.texi.
|
||||
@include make-stds.texi
|
||||
|
||||
@node Quick Reference, Make Errors, Makefile Conventions, Top
|
||||
@node Quick Reference, Error Messages, Makefile Conventions, Top
|
||||
@appendix Quick Reference
|
||||
|
||||
This appendix summarizes the directives, text manipulation functions,
|
||||
@@ -9402,6 +9445,11 @@ The flags given to @code{make}. You can set this in the environment or
|
||||
a makefile to set flags.@*
|
||||
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
||||
|
||||
It is @emph{never} appropriate to use @code{MAKEFLAGS} directly on a
|
||||
command line: its contents may not be quoted correctly for use in the
|
||||
shell. Always allow recursive @code{make}'s to obtain these values
|
||||
through the environment from its parent.
|
||||
|
||||
@item MAKECMDGOALS
|
||||
|
||||
The targets given to @code{make} on the command line. Setting this
|
||||
@@ -9425,11 +9473,11 @@ order.@*
|
||||
@xref{Libraries/Search, ,Directory Search for Link Libraries}.
|
||||
@end table
|
||||
|
||||
@node Make Errors, Complex Makefile, Quick Reference, Top
|
||||
@node Error Messages, Complex Makefile, Quick Reference, Top
|
||||
@comment node-name, next, previous, up
|
||||
@appendix Errors Generated by Make
|
||||
|
||||
Here is a list of the most common errors you might see generated by
|
||||
Here is a list of the more common errors you might see generated by
|
||||
@code{make}, and some information about what they mean and how to fix
|
||||
them.
|
||||
|
||||
@@ -9575,7 +9623,7 @@ sequential manner.
|
||||
|
||||
@end table
|
||||
|
||||
@node Complex Makefile, Concept Index, Make Errors, Top
|
||||
@node Complex Makefile, Concept Index, Error Messages, Top
|
||||
@appendix Complex Makefile Example
|
||||
|
||||
Here is the makefile for the GNU @code{tar} program. This is a
|
||||
|
||||
24
read.c
24
read.c
@@ -287,7 +287,7 @@ read_makefile (filename, flags)
|
||||
unsigned int commands_len = 200;
|
||||
char *commands;
|
||||
unsigned int commands_idx = 0;
|
||||
unsigned int cmds_started;
|
||||
unsigned int cmds_started, tgts_started;
|
||||
char *p;
|
||||
char *p2;
|
||||
int len, reading_target;
|
||||
@@ -313,9 +313,12 @@ read_makefile (filename, flags)
|
||||
{ \
|
||||
if (filenames != 0) \
|
||||
{ \
|
||||
struct floc fi; \
|
||||
fi.filenm = fileinfo.filenm; \
|
||||
fi.lineno = tgts_started; \
|
||||
record_files (filenames, pattern, pattern_percent, deps, \
|
||||
cmds_started, commands, commands_idx, two_colon, \
|
||||
&fileinfo, !(flags & RM_NO_DEFAULT_GOAL)); \
|
||||
&fi, !(flags & RM_NO_DEFAULT_GOAL)); \
|
||||
using_filename |= commands_idx > 0; \
|
||||
} \
|
||||
filenames = 0; \
|
||||
@@ -327,7 +330,7 @@ read_makefile (filename, flags)
|
||||
fileinfo.lineno = 1;
|
||||
|
||||
pattern_percent = 0;
|
||||
cmds_started = fileinfo.lineno;
|
||||
cmds_started = tgts_started = fileinfo.lineno;
|
||||
|
||||
if (ISDB (DB_VERBOSE))
|
||||
{
|
||||
@@ -755,6 +758,7 @@ read_makefile (filename, flags)
|
||||
/* Record the previous rule. */
|
||||
|
||||
record_waiting_files ();
|
||||
tgts_started = fileinfo.lineno;
|
||||
|
||||
/* Search the line for an unquoted ; that is not after an
|
||||
unquoted #. */
|
||||
@@ -1540,7 +1544,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
char *implicit_percent;
|
||||
|
||||
nextf = filenames->next;
|
||||
free ((char *) filenames);
|
||||
free (filenames);
|
||||
|
||||
implicit_percent = find_percent (name);
|
||||
implicit |= implicit_percent != 0;
|
||||
@@ -1608,6 +1612,12 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
continue;
|
||||
o = patsubst_expand (buffer, name, pattern, d->name,
|
||||
pattern_percent, percent);
|
||||
/* If the name expanded to the empty string, that's
|
||||
illegal. */
|
||||
if (o == buffer)
|
||||
fatal (flocp,
|
||||
_("target `%s' leaves prerequisite pattern empty"),
|
||||
name);
|
||||
free (d->name);
|
||||
d->name = savestring (buffer, o - buffer);
|
||||
}
|
||||
@@ -1627,7 +1637,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
/* If CMDS == F->CMDS, this target was listed in this rule
|
||||
more than once. Just give a warning since this is harmless. */
|
||||
if (cmds != 0 && cmds == f->cmds)
|
||||
error (flocp, _("target `%s' given more than once in the same rule."),
|
||||
error (flocp,
|
||||
_("target `%s' given more than once in the same rule."),
|
||||
f->name);
|
||||
|
||||
/* Check for two single-colon entries both with commands.
|
||||
@@ -1636,7 +1647,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
else if (cmds != 0 && f->cmds != 0 && f->is_target)
|
||||
{
|
||||
error (&cmds->fileinfo,
|
||||
_("warning: overriding commands for target `%s'"), f->name);
|
||||
_("warning: overriding commands for target `%s'"),
|
||||
f->name);
|
||||
error (&f->cmds->fileinfo,
|
||||
_("warning: ignoring old commands for target `%s'"),
|
||||
f->name);
|
||||
|
||||
28
remake.c
28
remake.c
@@ -43,6 +43,18 @@ Boston, MA 02111-1307, USA. */
|
||||
extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
|
||||
|
||||
|
||||
/* The test for circular dependencies is based on the 'updating' bit in
|
||||
`struct file'. However, double colon targets have seperate `struct
|
||||
file's; make sure we always use the base of the double colon chain. */
|
||||
|
||||
#define start_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
|
||||
->updating = 1)
|
||||
#define finish_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
|
||||
->updating = 0)
|
||||
#define is_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
|
||||
->updating)
|
||||
|
||||
|
||||
/* Incremented when a command is started (under -n, when one would be). */
|
||||
unsigned int commands_started = 0;
|
||||
|
||||
@@ -282,7 +294,7 @@ update_file (file, depth)
|
||||
if (f->considered == considered)
|
||||
{
|
||||
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
|
||||
return 0;
|
||||
return f->command_state == cs_finished ? f->update_status : 0;
|
||||
}
|
||||
|
||||
/* This loop runs until we start commands for a double colon rule, or until
|
||||
@@ -368,7 +380,7 @@ update_file_1 (file, depth)
|
||||
++depth;
|
||||
|
||||
/* Notice recursive update of the same file. */
|
||||
file->updating = 1;
|
||||
start_updating (file);
|
||||
|
||||
/* Looking at the file's modtime beforehand allows the possibility
|
||||
that its name may be changed by a VPATH search, and thus it may
|
||||
@@ -416,7 +428,7 @@ update_file_1 (file, depth)
|
||||
mtime = file_mtime (d->file);
|
||||
check_renamed (d->file);
|
||||
|
||||
if (d->file->updating)
|
||||
if (is_updating (d->file))
|
||||
{
|
||||
error (NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
@@ -494,7 +506,7 @@ update_file_1 (file, depth)
|
||||
}
|
||||
}
|
||||
|
||||
file->updating = 0;
|
||||
finish_updating (file);
|
||||
|
||||
DBF (DB_VERBOSE, _("Finished prerequisites of target file `%s'.\n"));
|
||||
|
||||
@@ -788,7 +800,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
int dep_status = 0;
|
||||
|
||||
++depth;
|
||||
file->updating = 1;
|
||||
start_updating (file);
|
||||
|
||||
if (!file->intermediate)
|
||||
/* If this is a non-intermediate file, update it and record
|
||||
@@ -840,7 +852,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
d = file->deps;
|
||||
while (d != 0)
|
||||
{
|
||||
if (d->file->updating)
|
||||
if (is_updating (d->file))
|
||||
{
|
||||
error (NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
@@ -879,7 +891,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
file->updating = 0;
|
||||
finish_updating (file);
|
||||
return dep_status;
|
||||
}
|
||||
|
||||
@@ -1085,7 +1097,7 @@ f_mtime (file, search)
|
||||
/* The archive doesn't exist, so it's members don't exist either. */
|
||||
return (FILE_TIMESTAMP) -1;
|
||||
|
||||
mtime = ar_member_date (file->hname);
|
||||
mtime = FILE_TIMESTAMP_FROM_S_AND_NS (ar_member_date (file->hname), 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,38 @@
|
||||
2000-04-04 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/functions/word: wordlist doesn't swap arguments anymore.
|
||||
|
||||
2000-03-27 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/statipattrules: Test that static pattern rules
|
||||
whose prerequisite patterns resolve to empty strings throw an
|
||||
error (instead of dumping core). Fixes PR/1670.
|
||||
|
||||
* scripts/features/reinvoke: Make more robust by touching "b"
|
||||
first, to ensure it's not newer than "a".
|
||||
Reported by Marco Franzen <Marco.Franzen@Thyron.com>.
|
||||
* scripts/options/dash-n: Ditto.
|
||||
|
||||
* scripts/functions/call: Whoops. The fix to PR/1527 caused
|
||||
recursive invocations of $(call ...) to break. I can't come up
|
||||
with any way to get both working at the same time, so I backed out
|
||||
the fix to 1527 and added a test case for recursive calls. This
|
||||
also tests the fix for PR/1610.
|
||||
|
||||
* scripts/features/double_colon: Test that circular dependencies
|
||||
in double-colon rule sets are detected correctly (PR/1671).
|
||||
|
||||
2000-03-26 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/targets/INTERMEDIATE: Test that make doesn't remove
|
||||
.INTERMEDIATE files when given on the command line (PR/1669).
|
||||
|
||||
2000-03-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/options/dash-k: Add a test for error detection by
|
||||
multiple targets depending on the same prerequisite with -k.
|
||||
For PR/1634.
|
||||
|
||||
2000-02-07 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/escape: Add a test for backslash-escaped spaces
|
||||
|
||||
@@ -36,6 +36,9 @@ two: ; @echo two
|
||||
|
||||
f1.h f2.h: ; @echo $@
|
||||
|
||||
d :: ; @echo ok
|
||||
d :: d ; @echo oops
|
||||
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
@@ -95,6 +98,12 @@ $answer = "f2.h\nfoo SECOND\n";
|
||||
$answer = "f2.h\nfoo SECOND\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 8: Test circular dependency check; PR/1671
|
||||
|
||||
&run_make_with_options($makefile, "d", &get_logfile, 0);
|
||||
$answer = "ok\n$make_name: Circular d <- d dependency dropped.\noops\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 8: I don't grok why this is different than the above, but it is...
|
||||
#
|
||||
# Hmm... further testing indicates this might be timing-dependent?
|
||||
|
||||
@@ -65,7 +65,8 @@ EOM
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch('a','b');
|
||||
&touch('b');
|
||||
&touch('a');
|
||||
sleep(2);
|
||||
&touch('c');
|
||||
|
||||
|
||||
@@ -1,66 +1,67 @@
|
||||
$description = "The following test creates a makefile to test static \n"
|
||||
."pattern rules. Static pattern rules are rules which \n"
|
||||
."specify multiple targets and construct the dependency \n"
|
||||
."names for each target based on the target name. ";
|
||||
# -*-perl-*-
|
||||
$description = "Test handling of static pattern rules.";
|
||||
|
||||
$details = "The makefile created in this test has three targets. The \n"
|
||||
."filter command is used to get those target names ending in \n"
|
||||
.".o and statically creates a compile command with the target\n"
|
||||
."name and the target name with .c. It also does the same thing\n"
|
||||
."for another target filtered with .elc and creates a command\n"
|
||||
."to emacs a .el file";
|
||||
$details = "\
|
||||
The makefile created in this test has three targets. The
|
||||
filter command is used to get those target names ending in
|
||||
.o and statically creates a compile command with the target
|
||||
name and the target name with .c. It also does the same thing
|
||||
for another target filtered with .elc and creates a command
|
||||
to emacs a .el file";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
print MAKEFILE <<'EOF';
|
||||
files = foo.elc bar.o lose.o
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "files = foo.elc bar.o lose.o \n\n"
|
||||
."\$(filter %.o,\$(files)): %.o: %.c\n"
|
||||
."\t\@echo CC -c \$(CFLAGS) \$< -o \$@ \n"
|
||||
."\$(filter %.elc,\$(files)): %.elc: %.el \n"
|
||||
."\t\@echo emacs \$< \n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
$(filter %.o,$(files)): %.o: %.c ; @echo CC -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $<
|
||||
EOF
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch("bar.c","lose.c");
|
||||
|
||||
&touch('bar.c', 'lose.c');
|
||||
|
||||
# TEST #1
|
||||
# -------
|
||||
|
||||
&run_make_with_options($makefile,
|
||||
"",
|
||||
&get_logfile,
|
||||
0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
&run_make_with_options($makefile, '', &get_logfile);
|
||||
$answer = "CC -c bar.c -o bar.o\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
# TEST #2
|
||||
# -------
|
||||
&run_make_with_options($makefile,"lose.o",&get_logfile);
|
||||
|
||||
&run_make_with_options($makefile, 'lose.o', &get_logfile);
|
||||
$answer = "CC -c lose.c -o lose.o\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
# TEST #3
|
||||
# -------
|
||||
&touch("foo.el");
|
||||
|
||||
&run_make_with_options($makefile,"foo.elc",&get_logfile);
|
||||
|
||||
&run_make_with_options($makefile, 'foo.elc', &get_logfile);
|
||||
$answer = "emacs foo.el\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
unlink('foo.el', 'bar.c', 'lose.c');
|
||||
|
||||
|
||||
# TEST #4 -- PR/1670: don't core dump on invalid static pattern rules
|
||||
# -------
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
open(MAKEFILE, "> $makefile2");
|
||||
print MAKEFILE "foo: foo%: % ; \@echo $@\n";
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile2, '', &get_logfile, 512);
|
||||
$answer = "$makefile2:1: *** target `foo' leaves prerequisite pattern empty. Stop.\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink("foo.el","bar.c","lose.c");
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -26,23 +26,35 @@ my-notdir = $(call notdir,$(1))
|
||||
my-foreach = $(foreach $(1),$(2),$(3))
|
||||
my-if = $(if $(1),$(2),$(3))
|
||||
|
||||
# Test recursive invocations of call with different arguments
|
||||
#
|
||||
one = $(1) $(2) $(3)
|
||||
two = $(call one,$(1),foo,$(2))
|
||||
|
||||
|
||||
all: ; @echo '$(call reverse,bar,foo)'; \
|
||||
echo '$(call map,origin,MAKE reverse map)'; \
|
||||
echo '$(call my-notdir,a/b c/d e/f)'; \
|
||||
echo '$(call my-foreach)'; \
|
||||
echo '$(call my-foreach,a,,,)'; \
|
||||
echo '$(call my-foreach,a,x y z,$(a)$(a))'; \
|
||||
echo '$(call my-if,a,b,c)'; \
|
||||
echo '$(call my-if,,$(warning don't print this),ok)'
|
||||
echo '$(call two,bar,baz)'
|
||||
|
||||
EOMAKE
|
||||
|
||||
# These won't work until/unless PR/1527 is resolved.
|
||||
# echo '$(call my-foreach,a,x y z,$(a)$(a))'; \
|
||||
# echo '$(call my-if,,$(warning don't print this),ok)'
|
||||
#
|
||||
# $answer = "xx yy zz\nok\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile);
|
||||
$answer = "foo bar\ndefault file file\nb d f\n\n\nxx yy zz\nb\nok\n";
|
||||
$answer = "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\n";
|
||||
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
1;
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
$description = "The following test creates a makefile to test the word, words,\n"
|
||||
."and wordlist functions.\n";
|
||||
# -*-perl-*-
|
||||
$description = "Test the word, words, and wordlist functions.\n";
|
||||
|
||||
$details = "The word function will return the number of words in a variable or\n"
|
||||
."the word specified. The test will produce a variable with a large\n"
|
||||
."number of words in it, determine the number of word and then read\n"
|
||||
."each one back.\n";
|
||||
$details = "\
|
||||
Produce a variable with a large number of words in it,
|
||||
determine the number of words, and then read each one back.\n";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "string := word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl \n"
|
||||
."string2 := \$(string) \$(string) \$(string) \$(string) \$(string) \$(string) \$(string)\n"
|
||||
."string3 := \$(string2) \$(string2) \$(string2) \$(string2) \$(string2) \$(string2) \$(string2)\n"
|
||||
."string4 := \$(string3) \$(string3) \$(string3) \$(string3) \$(string3) \$(string3) \$(string3)\n"
|
||||
."all: \n"
|
||||
."\t\@echo \$(words \$(string)) \n"
|
||||
."\t\@echo \$(words \$(string4)) \n"
|
||||
."\t\@echo \$(word 1, \$(string)) \n"
|
||||
."\t\@echo \$(word 100, \$(string)) \n"
|
||||
."\t\@echo \$(word 1, \$(string)) \n"
|
||||
."\t\@echo \$(word 1000, \$(string3)) \n"
|
||||
."\t\@echo \$(wordlist 3, 4, \$(string)) \n"
|
||||
."\t\@echo \$(wordlist 4, 3, \$(string)) \n"
|
||||
."\t\@echo \$(wordlist 1, 6, \$(string)) \n"
|
||||
."\t\@echo \$(wordlist 7, 5, \$(string)) \n"
|
||||
."\t\@echo \$(wordlist 100, 110, \$(string)) \n"
|
||||
."\t\@echo \$(wordlist 7, 10, \$(string2)) \n"
|
||||
;
|
||||
print MAKEFILE <<'EOF';
|
||||
string := word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl
|
||||
string2 := $(string) $(string) $(string) $(string) $(string) $(string) $(string)
|
||||
string3 := $(string2) $(string2) $(string2) $(string2) $(string2) $(string2) $(string2)
|
||||
string4 := $(string3) $(string3) $(string3) $(string3) $(string3) $(string3) $(string3)
|
||||
all:
|
||||
@echo $(words $(string))
|
||||
@echo $(words $(string4))
|
||||
@echo $(word 1, $(string))
|
||||
@echo $(word 100, $(string))
|
||||
@echo $(word 1, $(string))
|
||||
@echo $(word 1000, $(string3))
|
||||
@echo $(wordlist 3, 4, $(string))
|
||||
@echo $(wordlist 4, 3, $(string))
|
||||
@echo $(wordlist 1, 6, $(string))
|
||||
@echo $(wordlist 5, 7, $(string))
|
||||
@echo $(wordlist 100, 110, $(string))
|
||||
@echo $(wordlist 7, 10, $(string2))
|
||||
EOF
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ print MAKEFILE "string := word.pl general_test2.pl FORCE.pl word.pl generic_t
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile,0);
|
||||
&run_make_with_options($makefile, "", &get_logfile);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
|
||||
@@ -47,7 +47,7 @@ $answer = "6\n"
|
||||
."word.pl\n"
|
||||
."\n"
|
||||
."FORCE.pl word.pl\n"
|
||||
."FORCE.pl word.pl\n"
|
||||
."\n"
|
||||
."word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl\n"
|
||||
."generic_test.perl MAKEFILES_variable.pl\n"
|
||||
."\n"
|
||||
@@ -58,13 +58,7 @@ $answer = "6\n"
|
||||
# to send the name of the last logfile created. You may also use
|
||||
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,36 +1,37 @@
|
||||
$description = "The following test creates a makefile to test the -k option.\n"
|
||||
."Normally, make gives up immediately if an error happens \n"
|
||||
."that make has not been told to ignore. However, if the -k\n"
|
||||
."option is specified, make continues to consider the other\n"
|
||||
."dependencies of the pending targets.";
|
||||
# -*-perl-*-
|
||||
|
||||
$details = "The makefile created in this test is a simulation of building \n"
|
||||
."a small product. However, the trick to this one is that one \n"
|
||||
."of the dependencies of the main target does not exist. \n"
|
||||
."Without the -k option, make would fail immediately and not \n"
|
||||
."build any part of the target. What we are looking for here, \n"
|
||||
."is that make builds the rest of the dependencies even though \n"
|
||||
."it knows that at the end it will fail to rebuild the main target.";
|
||||
$description = "Test the make -k (don't stop on error) option.\n";
|
||||
|
||||
$details = "\
|
||||
The makefile created in this test is a simulation of building
|
||||
a small product. However, the trick to this one is that one
|
||||
of the dependencies of the main target does not exist.
|
||||
Without the -k option, make would fail immediately and not
|
||||
build any part of the target. What we are looking for here,
|
||||
is that make builds the rest of the dependencies even though
|
||||
it knows that at the end it will fail to rebuild the main target.";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "VPATH = $workdir\n";
|
||||
print MAKEFILE "edit: main.o kbd.o commands.o display.o \n";
|
||||
print MAKEFILE "\t\@echo cc -o edit main.o kbd.o commands.o display.o \n";
|
||||
print MAKEFILE <<EOF;
|
||||
VPATH = $workdir
|
||||
edit: main.o kbd.o commands.o display.o
|
||||
\t\@echo cc -o edit main.o kbd.o commands.o display.o
|
||||
|
||||
print MAKEFILE "main.o : main.c defs.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c main.c\n";
|
||||
main.o : main.c defs.h
|
||||
\t\@echo cc -c main.c
|
||||
|
||||
print MAKEFILE "kbd.o : kbd.c defs.h command.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c kbd.c\n";
|
||||
kbd.o : kbd.c defs.h command.h
|
||||
\t\@echo cc -c kbd.c
|
||||
|
||||
print MAKEFILE "commands.o : command.c defs.h command.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c commands.c\n";
|
||||
commands.o : command.c defs.h command.h
|
||||
\t\@echo cc -c commands.c
|
||||
|
||||
print MAKEFILE "display.o : display.c defs.h buffer.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c display.c\n";
|
||||
display.o : display.c defs.h buffer.h
|
||||
\t\@echo cc -c display.c
|
||||
EOF
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
@@ -45,29 +46,55 @@ close(MAKEFILE);
|
||||
|
||||
&touch(@files_to_touch);
|
||||
|
||||
if ($vos)
|
||||
{
|
||||
$error_code = 3307;
|
||||
if ($vos) {
|
||||
$error_code = 3307;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_code = 512;
|
||||
else {
|
||||
$error_code = 512;
|
||||
}
|
||||
|
||||
&run_make_with_options($makefile,"-k",&get_logfile,$error_code);
|
||||
&run_make_with_options($makefile, "-k", &get_logfile, $error_code);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "cc -c main.c\n"
|
||||
."$make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.\n"
|
||||
."cc -c commands.c\n"
|
||||
."cc -c display.c\n"
|
||||
."$make_name: Target `edit' not remade because of errors.\n";
|
||||
$answer = "cc -c main.c
|
||||
$make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.
|
||||
cc -c commands.c
|
||||
cc -c display.c
|
||||
$make_name: Target `edit' not remade because of errors.\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
if (&compare_output($answer,&get_logfile(1)))
|
||||
{
|
||||
unlink @files_to_touch;
|
||||
}
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink(@files_to_touch) unless $keep;
|
||||
|
||||
|
||||
# TEST 1: Make sure that top-level targets that depend on targets that
|
||||
# previously failed to build, aren't attempted. Regression for PR/1634.
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE, "> $makefile2");
|
||||
print MAKEFILE <<'EOF';
|
||||
.SUFFIXES:
|
||||
|
||||
all: exe1 exe2; @echo making $@
|
||||
|
||||
exe1 exe2: lib; @echo cp $^ $@
|
||||
|
||||
lib: foo.o; @echo cp $^ $@
|
||||
|
||||
foo.o: ; exit 1
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
|
||||
|
||||
$answer = "exit 1
|
||||
$make_name: *** [foo.o] Error 1
|
||||
$make_name: Target `all' not remade because of errors.\n";
|
||||
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
1;
|
||||
|
||||
@@ -18,17 +18,20 @@ close(MAKEFILE);
|
||||
|
||||
&touch('orig');
|
||||
|
||||
# TEST 0
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile);
|
||||
$answer = "echo >> intermediate\necho >> final\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 1
|
||||
|
||||
&run_make_with_options($makefile, "-Worig -n", &get_logfile);
|
||||
$answer = "echo >> intermediate\necho >> final\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink('orig', 'intermediate', 'final');
|
||||
|
||||
# TEST2
|
||||
# We consider the actual updated timestamp of targets with all
|
||||
# recursive commands, even with -n.
|
||||
|
||||
@@ -46,14 +49,24 @@ EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch('a', 'b');
|
||||
&touch('b');
|
||||
# Sometimes, on my Solaris 2.5.1 box with a NetApp filesystem NFS-mounted,
|
||||
# just touching b first then a isn't good enough: the nsec field in the
|
||||
# stat result shows b is _newer_ than a once every 5 or 6 tries!!! I've
|
||||
# no idea what this is about, but that's why there's a sleep(1) here...
|
||||
sleep(1);
|
||||
&touch('a');
|
||||
sleep(1);
|
||||
&touch('c');
|
||||
|
||||
# TEST 2
|
||||
|
||||
&run_make_with_options($makefile2, "", &get_logfile);
|
||||
$answer = "$make_name: `a' is up to date.\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 3
|
||||
|
||||
&run_make_with_options($makefile2, "-n", &get_logfile);
|
||||
$answer = "$make_name: `a' is up to date.\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
@@ -77,9 +77,15 @@ sleep($wtime);
|
||||
$answer = "cp foo.f foo.e\ncp bar.f bar.e\ncat foo.e bar.e > foo.c\nrm foo.e bar.e\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST #6 -- added for PR/1669: don't remove files mentioned on the cmd line.
|
||||
|
||||
&run_make_with_options($makefile,'foo.e',&get_logfile);
|
||||
$answer = "cp foo.f foo.e\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink('foo.f', 'foo.e', 'foo.d', 'foo.c', 'bar.f', 'bar.e', 'bar.d', 'bar.c');
|
||||
|
||||
# TEST #6 -- added for PR/1423
|
||||
# TEST #7 -- added for PR/1423
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
|
||||
@@ -94,7 +100,7 @@ EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile2, "-R", &get_logfile);
|
||||
&run_make_with_options($makefile2, '-R', &get_logfile);
|
||||
$answer = "touch foo.a\ntouch foo\nrm foo.a\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
38
variable.c
38
variable.c
@@ -136,17 +136,18 @@ define_variable_in_set (name, length, value, origin, recursive, set, flocp)
|
||||
Returns address of the `struct variable' containing all info
|
||||
on the variable, or nil if no such variable is defined.
|
||||
|
||||
If LISTP is not nil, return a pointer to the setlist where
|
||||
the variable was found. If the variable wasn't found, the
|
||||
value of LISTP is unchanged. */
|
||||
If we find a variable which is in the process of being expanded,
|
||||
try to find one further up the set_list chain. If we don't find
|
||||
one that isn't being expanded, return a pointer to whatever we
|
||||
_did_ find. */
|
||||
|
||||
struct variable *
|
||||
lookup_variable_setlist (name, length, listp)
|
||||
lookup_variable (name, length)
|
||||
char *name;
|
||||
unsigned int length;
|
||||
struct variable_set_list **listp;
|
||||
{
|
||||
register struct variable_set_list *setlist;
|
||||
struct variable *firstv = 0;
|
||||
|
||||
register unsigned int i;
|
||||
register unsigned int rawhash = 0;
|
||||
@@ -161,21 +162,31 @@ lookup_variable_setlist (name, length, listp)
|
||||
register unsigned int hashval = rawhash % set->buckets;
|
||||
register struct variable *v;
|
||||
|
||||
/* Look through this set list. */
|
||||
for (v = set->table[hashval]; v != 0; v = v->next)
|
||||
if (*v->name == *name
|
||||
&& strneq (v->name + 1, name + 1, length - 1)
|
||||
&& v->name[length] == 0)
|
||||
{
|
||||
if (listp)
|
||||
*listp = setlist;
|
||||
return v;
|
||||
}
|
||||
&& v->name[length] == '\0')
|
||||
break;
|
||||
|
||||
/* If we didn't find anything, go to the next set list. */
|
||||
if (!v)
|
||||
continue;
|
||||
|
||||
/* If it's not being expanded already, we're done. */
|
||||
if (!v->expanding)
|
||||
return v;
|
||||
|
||||
/* It is, so try to find another one. If this is the first one we've
|
||||
seen, keep a pointer in case we don't find anything else. */
|
||||
if (!firstv)
|
||||
firstv = v;
|
||||
}
|
||||
|
||||
#ifdef VMS
|
||||
/* since we don't read envp[] on startup, try to get the
|
||||
variable via getenv() here. */
|
||||
|
||||
if (!firstv)
|
||||
{
|
||||
char *vname = alloca (length + 1);
|
||||
char *value;
|
||||
@@ -229,10 +240,9 @@ lookup_variable_setlist (name, length, listp)
|
||||
return define_variable (vname, length, value, o_env, 1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* VMS */
|
||||
|
||||
return 0;
|
||||
return firstv;
|
||||
}
|
||||
|
||||
/* Lookup a variable whose name is a string starting at NAME
|
||||
|
||||
12
variable.h
12
variable.h
@@ -95,10 +95,7 @@ extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *
|
||||
char *pattern_percent, char *replace_percent));
|
||||
|
||||
/* expand.c */
|
||||
extern char *recursively_expand_setlist PARAMS ((struct variable *v,
|
||||
struct variable_set_list *l));
|
||||
|
||||
#define recursively_expand(v) recursively_expand_setlist((v),(struct variable_set_list *)0)
|
||||
extern char *recursively_expand PARAMS ((struct variable *v));
|
||||
|
||||
/* variable.c */
|
||||
extern struct variable_set_list *create_new_variable_set PARAMS ((void));
|
||||
@@ -111,12 +108,7 @@ extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix))
|
||||
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
||||
extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin, int target_var));
|
||||
|
||||
extern struct variable *lookup_variable_setlist
|
||||
PARAMS ((char *name, unsigned int length,
|
||||
struct variable_set_list **lisp));
|
||||
|
||||
#define lookup_variable(n,l) lookup_variable_setlist((n),(l),\
|
||||
(struct variable_set_list **)0)
|
||||
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
||||
|
||||
extern struct variable *define_variable_in_set
|
||||
PARAMS ((char *name, unsigned int length, char *value,
|
||||
|
||||
Reference in New Issue
Block a user